The "log_json" Module (v4)
This module depends on a third-party library (yyjson) and must be manually enabled at compile time.
Once you have installed the dependency you can enable this module using the following command:
./configure --enable-extras log_json
Description
This module provides the ability to log to JSON.
Configuration
To load this module use the following <module>
tag:
<module name="log_json">
<log>
This module extends the core <log>
tags with the following fields:
Name | Type | Default Value | Description |
---|---|---|---|
method | Text | None | Required! This MUST be set to json, json-stderr, or json-stdout to use JSON logging. |
target | Text | None | Required! If using the json method the location to write the log to. |
Example Usage
Logs JSON messages to inspircd.json
:
<log method="json"
target="inspircd.json"
level="normal"
type="* -USERINPUT -USEROUTPUT">
Logs JSON messages to the standard error stream:
<log method="json-stderr"
level="normal"
type="* -USERINPUT -USEROUTPUT">
Logs JSON messages to the standard output stream:
<log method="json-stdout"
level="normal"
type="* -USERINPUT -USEROUTPUT">