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.

Syntax
log { source { : 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.
 * : if you want to write to *NIX syslog.
 * : 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::snomask
This specifies to which snomask the messages should go. This should be a single letter.

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.