Log block

In UnrealIRCd 6 the log block is used to log server messages to log files but also to decide which messages get sent to which snomasks (server notices). It is normal to have several log blocks.

If you have no log block that logs to disk then UnrealIRCd will by default log everything to ircd.log. Logging to disk is available in standard text format, but also in json format.

Syntax
log { source { Or a combination of the above, eg. You can also use negative matchers by use of an exclamation mark, eg:.
 * A log level severity, like:
 * An event id, like:

See Log sources for a full list of subsystems and event ids.

Finally, there are also two special log sources:
 * all: this includes everything
 * nomatch: this includes anything that is not matched elsewhere. It should only be used for snomask s, as is done in conf/snomasks.default.conf. End-users should not change/use it.

destination
Here you specify what needs to be done with the log messages selected in source earlier.

destination::file
The filename specifies where to log to. Examples:
 * : a literal filename
 * : a filename with strftime formatting. This example will give you a new log file for every day such as: ircd.2020-01-31.log.
 * : a full path (NOTE: be sure UnrealIRCd can write to the directory)

It also has the following options:
 * maxsize: a maximum size of the log file. When the log file reaches this limit then log file will be renamed to name-of-log-file.old (overwriting any previous such .old file). You can use K/M/G to specify kilobytes/megabytes/gigabytes.
 * type: the logging output type. Use text for human readable text, or json for machine readable output, see JSON logging.

destination::syslog
If you want to log to *NIX syslog.

destination::snomask
This specifies to which snomask the messages should go. This should be a single letter.

destination::remote
This means the log message should be forwarded to all other servers. This is used in conf/snomasks.default.conf so things like link errors and oper-ups can be seen network-wide. End-users probably don't need to change/use this. Important: if you use this incorrectly, you may see duplicate server notices.

Log all messages to disk
This simply logs all messages to disk in a human readable way: log { source { !debug; all; }       destination { file "ircd.log" { maxsize 100M; } } }

Log all messages to disk in JSON format
This uses the JSON logging format. This is easier to parse by machines (external programs): log { source { all; }       destination { file "ircd.json.log" { maxsize 100M; type json; } } }

Log to an snomask
This sends all log messages regarding local client connects and disconnects to the +c snomask (this is already done by default in conf/snomasks.default.conf): /* Local client connects snomask - 'c' */ log { source { connect.LOCAL_CLIENT_CONNECT; connect.LOCAL_CLIENT_DISCONNECT; }       destination { snomask c;       } }

You are free to create new snomasks with your own sources that you select on.