public final class JsonLogHandler extends AbstractLogHandler implements AutoClosable
Appends one JSON object per line to a UTF-8 JSONL file.
import klyn.logging.handler
handler = JsonLogHandler("application.jsonl")| Modifier and Type | Member | Description |
|---|---|---|
| public | JsonLogHandlerJsonLogHandler(path as String, minimumLevel as LogLevel = LogLevel.TRACE, append as Boolean = true) |
Creates a JSON-lines handler. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | closeclose() as Void |
Closes the JSONL file. |
| public override | flushflush() as Void |
Flushes buffered JSON lines to the file. |
| public override | handlehandle(event as LogEvent) as Void |
Writes one JSON object atomically. |