OptionalcontextUser-provided structured context data. Can contain any application-specific data.
OptionalenvironmentDeployment environment.
OptionalerrorStructured error information.
Unique identifier for this log entry. Format: "timestamp-randomComponent" (e.g., "1733938475123-abc123xyz")
Log level following syslog RFC5424 severity.
OptionalloggerLogger instance identifier. Useful for multi-logger applications.
Plain text log message without any formatting codes. This is the primary message content for all transports.
OptionalmetadataAutomatically collected runtime information.
OptionalschemaMAGIC schema version for compatibility.
OptionalserviceService name for microservice architectures. Maps to service.name in OpenTelemetry.
OptionalstylesOptional style ranges for reconstructing formatted output. Each entry is [startIndex, endIndex, styleDescriptor]. Example: [[0, 6, "red.bold"], [12, 29, "cyan"]]
OptionaltagsCategorization tags for filtering and routing.
Unix timestamp in milliseconds for efficient sorting/filtering. Use toISOString() for human-readable display.
OptionaltraceDistributed 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