grafbase_sdk/host_io/
access_log.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! Provides a simple access log for the gateway.
//!
//! The access logs must be enabled in the gateway configuration for this module to work:
//!
//! ```toml,no_run
//! [gateway.access_logs]
//! enabled = true
//! path = "/path/to/logs"
//! rotate = "daily"
//! mode = "blocking"
//! ```

pub use crate::wit::{AccessLog, LogError};

/// Stores the given arbitrary bytes to the access log. The data can be generated in any format,
/// and must be serialized as bytes before sending.
pub fn send(data: &[u8]) -> Result<(), LogError> {
    AccessLog::send(data)
}