grafbase_sdk/host_io/
access_log.rs

1//! Provides a simple access log for the gateway.
2//!
3//! The access logs must be enabled in the gateway configuration for this module to work:
4//!
5//! ```toml,no_run
6//! [gateway.access_logs]
7//! enabled = true
8//! path = "/path/to/logs"
9//! rotate = "daily"
10//! mode = "blocking"
11//! ```
12
13pub use crate::wit::{AccessLog, LogError};
14
15/// Stores the given arbitrary bytes to the access log. The data can be generated in any format,
16/// and must be serialized as bytes before sending.
17pub fn send(data: &[u8]) -> Result<(), LogError> {
18    AccessLog::send(data)
19}