hecate_plugin_logger (hecate_sdk v0.6.2)
View SourceJSON log formatter for OTP logger.
Produces one JSON line per log event, suitable for journald and machine parsing. Uses the OTP 27 json module.
Output example: {"ts":"2026-03-15T10:30:00.123456Z","level":"info", "msg":"Store ready","plugin":"martha","pid":"pid"}
Configure in sys.config: {kernel, [{logger, [{handler, default, logger_std_h, #{ formatter => {hecate_plugin_logger, #{}} }}]}]}
Summary
Functions
-spec check_config(logger:formatter_config()) -> ok | {error, term()}.
Validate formatter config. Accepts any map.
-spec format(logger:log_event(), logger:formatter_config()) -> unicode:chardata().
Format a log event as a single JSON line.