Optional
contextUser-provided structured context data. Can contain any application-specific data.
Optional
environmentDeployment environment.
Optional
errorStructured error information.
Unique identifier for this log entry. Format: "timestamp-randomComponent" (e.g., "1733938475123-abc123xyz")
Log level following syslog RFC5424 severity.
Optional
loggerLogger instance identifier. Useful for multi-logger applications.
Plain text log message without any formatting codes. This is the primary message content for all transports.
Optional
metadataAutomatically collected runtime information.
Optional
schemaMAGIC schema version for compatibility.
Optional
serviceService name for microservice architectures. Maps to service.name in OpenTelemetry.
Optional
stylesOptional style ranges for reconstructing formatted output. Each entry is [startIndex, endIndex, styleDescriptor]. Example: [[0, 6, "red.bold"], [12, 29, "cyan"]]
Optional
tagsCategorization tags for filtering and routing.
Unix timestamp in milliseconds for efficient sorting/filtering. Use toISOString() for human-readable display.
Optional
traceDistributed tracing context. Follows OpenTelemetry trace context specification.
MAGIC Schema v1 - Core log entry structure.
This interface implements the MAGIC Schema specification for cross-language compatibility and seamless observability integration.
See
https://github.com/magiclogger/magiclog-schema