# Logging Configuration Schema # Common schema for log level, format, and output { # Supported log levels LogLevel = [| 'trace, 'debug, 'info, 'warn, 'error |], # Supported log formats LogFormat = [| 'text, 'json |], LoggingConfig = { # Global log level level | LogLevel | default = 'info, # Log format format | LogFormat | default = 'text, # Log output destinations outputs | Array String | optional, # File Output Configuration file | { # Log file path path | String | optional, # Max file size in bytes max_size | Number | optional, # Maximum number of backup files to keep max_backups | Number | optional, # Max age of log file in days max_age | Number | optional, # Compress rotated files compress | Bool | default = false, } | optional, # Syslog Configuration syslog | { # Syslog server address address | String | optional, # Syslog facility facility | String | optional, # Syslog protocol (tcp, udp) protocol | String | optional, } | optional, # Structured Logging Fields fields | { # Service name field service_name | Bool | default = true, # Host name field hostname | Bool | default = true, # Process ID field pid | Bool | default = true, # Timestamp field timestamp | Bool | default = true, # Caller location field (file:line) caller | Bool | default = false, # Stack trace on error stack_trace | Bool | default = false, # Custom fields to include custom | Array String | optional, } | optional, # Sampling Configuration (reduce log volume) sampling | { # Enable log sampling enabled | Bool | default = false, # Initial log count before sampling initial | Number | optional, # Thereafter log every nth message thereafter | Number | optional, } | optional, # Module-specific Log Levels modules | { # Map of module_name -> log_level } | optional, # Performance Logging performance | { # Enable performance logging enabled | Bool | default = false, # Log slow operations (threshold in milliseconds) slow_threshold | Number | optional, # Include memory allocation info memory_info | Bool | default = false, } | optional, }, }