Message_templates.Log_eventLog event type - Immutable record representing a single log entry
Log events are the core data structure passed through the logging pipeline. They contain all information about a logged message including timestamp, level, template, rendered message, properties, and optional exception info.
val create :
?timestamp:Ptime.t ->
?exception_info:exn ->
?correlation_id:string ->
level:Level.t ->
message_template:string ->
rendered_message:string ->
properties:(string * Yojson.Safe.t) list ->
unit ->
tCreate a new log event.
val to_json_string : t -> stringOptimized direct JSON string generation. This builds the JSON string directly using a Buffer, avoiding intermediate Yojson.Safe.t structures and allocations. Use this for better performance when serializing to sinks.
val get_timestamp : t -> Ptime.tGet the event timestamp
val get_message_template : t -> stringGet the original message template
val get_rendered_message : t -> stringGet the fully rendered message
val get_properties : t -> (string * Yojson.Safe.t) listGet the structured properties list
val get_exception : t -> exn optionGet exception info if present
val get_correlation_id : t -> string optionGet correlation ID if present