Home /Modules/logger/FORMAT.md

FORMAT.md

logger/FORMAT.md · 54 line(s) · markdown

SLeeLa Packet Log Format 1

File Format

Required Fields

FieldTypeMeaning
formatstringFormat identifier
timestampstringUTC ISO-8601 timestamp
directionstringsent or received
severitystringtrace through critical
admissionstringaccepted, rejected, or error
protocolstringProtocol/generation
packet_bytesintegerNetwork packet/event byte count
heuristic_scorenumber0.0 through 1.0
sequenceintegerTransport/application sequence when known

Optional Fields

service, operation, source, destination, stream_id, request_id, reason, and payload_base64.

The payload field is emitted only when explicitly enabled.

Rotation

The logger never intentionally writes a segment beyond 240 MiB. Rotation occurs before the next complete JSON line would exceed the boundary. A record whose serialized representation alone exceeds 240 MiB is not written.

Ordering

Write order is preserved within a segment. Consumers may sort records by timestamp, direction, severity, protocol, size, or sequence.

Completed-Segment Copy / Remote Destination

When move_completed_segments is enabled and archive_directory is set, each completed 240 MiB log segment is copied to the configured destination as part of rotation. The complete file is flushed, copied, and size-verified before rotation advances to the next local segment.

Example configuration:

move_completed_segments = true
archive_directory = "/mnt/remote/sleela-logs"

The destination is a normal filesystem path. A remote drive or network share should be mounted by the operating system first. Existing destination names are preserved by selecting a .copy-N suffix rather than overwriting an earlier archive.

The local segment is retained by this safety-oriented copy operation. This means a remote destination can receive a full historical segment without making the local logging path dependent on the remote drive remaining available. If the destination is unavailable, the local log continues to be retained and the archive operation reports failure.