pub fn init_structured_logging(
config: &LoggingConfig,
service_name: &str,
environment: &str,
log_level: &str,
) -> Result<LogBuffer, LoggingError>Expand description
Initialize structured logging with JSON output
§Arguments
config- Logging configurationservice_name- Name of the service for log labelsenvironment- Environment name (dev, staging, prod)
§Returns
Returns a log buffer handle for accessing aggregated logs
§Example
use backbone_observability::logging::{init_structured_logging, LoggingConfig};
let config = LoggingConfig {
json_format: true,
..Default::default()
};
let buffer = init_structured_logging(&config, "my-service", "production", "info")?;