Loggers
options.loggers lists where the logs go. There are two types: CONSOLE and FILE. When loggers is not set,
the server logs to the console only; "loggers": [] turns logging off.
{ "$schema": "https://raw.githubusercontent.com/loopingz/smtp-relay/main/config.schema.json", "flows": { "local": { "filters": [{ "type": "whitelist", "ips": ["127.0.0.1"] }], "outputs": [{ "type": "log" }] } }, "options": { "authOptional": true, "loggers": [ { "type": "CONSOLE", "level": "INFO" }, { "type": "FILE", "level": "DEBUG", "filepath": "./smtp.log", "sizeLimit": 50000000 } ] }}level is one of ERROR, WARN, INFO, DEBUG and TRACE. A logger without level uses the LOG_LEVEL
environment variable, and INFO when it is not set.
At INFO, the server logs each accepted email (sender, recipients and flow), each refusal, the recipients no flow
delivered, and output errors. The SMTP protocol exchanges of the underlying server are logged at DEBUG: use it
to troubleshoot a client.
The log output, and the progress messages of the aws and gcp outputs (“Storing…”,
“Publishing cloudevent…”), are printed to the console directly: they do not go through these loggers, so a FILE
logger does not get them and "loggers": [] does not silence them.
Format
Section titled “Format”format sets the layout of a line: %(d)s is the date, %(l)s the level and %(m)s the message. The default is
%(d)s [%(l)s] %(m)s.
Log files
Section titled “Log files”A FILE logger appends to filepath. When the file reaches sizeLimit bytes, it is renamed with a number
appended (smtp.log2, smtp.log3…) and a new file is started; 0 disables the rotation.