rspamd_logger
Rspamd logger module is used to log messages from LUA API to the main rspamd logger. It supports legacy and modern interfaces allowing highly customized an convenient log functions. Here is an example of logger usage:
Functions:
Function | Description |
---|---|
logger.err(msg) |
Log message as an error. |
logger.warn(msg) |
Log message as a warning. |
logger.info(msg) |
Log message as an informational message. |
logger.message(msg) |
Log message as an notice message. |
logger.debug(msg) |
Log message as a debug message. |
logger.errx(fmt[, args) |
Extended interface to make an error log message. |
logger.warn(fmt[, args) |
Extended interface to make a warning log message. |
logger.infox(fmt[, args) |
Extended interface to make an informational log message. |
logger.infox(fmt[, args) |
Extended interface to make an informational log message. |
logger.debugx(fmt[, args) |
Extended interface to make a debug log message. |
logger.debugm(module, id, fmt[, args) |
Extended interface to make a debug log message. |
logger.slog(fmt[, args) |
Create string replacing percent params with corresponding arguments. |
logger.logx(level, module, id, fmt[, args) |
Extended interface to make a generic log message on any level. |
logger.log_level() |
Returns log level for a logger. |
The module rspamd_logger
defines the following functions.
logger.err(msg)
Log message as an error
Parameters:
msg {string}
: string to be loggedReturns:
No return
Back to module description.
logger.warn(msg)
Log message as a warning
Parameters:
msg {string}
: string to be loggedReturns:
No return
Back to module description.
logger.info(msg)
Log message as an informational message
Parameters:
msg {string}
: string to be loggedReturns:
No return
Back to module description.
logger.message(msg)
Log message as an notice message
Parameters:
msg {string}
: string to be loggedReturns:
No return
Back to module description.
logger.debug(msg)
Log message as a debug message
Parameters:
msg {string}
: string to be loggedReturns:
No return
Back to module description.
logger.errx(fmt[, args)
Extended interface to make an error log message
Parameters:
fmt {string}
: format string, arguments are encoded as %args {any}
: list of arguments to be replaced in %Returns:
No return
Back to module description.
logger.warn(fmt[, args)
Extended interface to make a warning log message
Parameters:
fmt {string}
: format string, arguments are encoded as %args {any}
: list of arguments to be replaced in %Returns:
No return
Back to module description.
logger.infox(fmt[, args)
Extended interface to make an informational log message
Parameters:
fmt {string}
: format string, arguments are encoded as %args {any}
: list of arguments to be replaced in %Returns:
No return
Back to module description.
logger.infox(fmt[, args)
Extended interface to make an informational log message
Parameters:
fmt {string}
: format string, arguments are encoded as %args {any}
: list of arguments to be replaced in %Returns:
No return
Back to module description.
logger.debugx(fmt[, args)
Extended interface to make a debug log message
Parameters:
fmt {string}
: format string, arguments are encoded as %args {any}
: list of arguments to be replaced in %Returns:
No return
Back to module description.
logger.debugm(module, id, fmt[, args)
Extended interface to make a debug log message
Parameters:
module {string}
: debug moduleid {task|cfg|pool|string}
: id to logfmt {string}
: format string, arguments are encoded as %args {any}
: list of arguments to be replaced in %Returns:
No return
Back to module description.
logger.slog(fmt[, args)
Create string replacing percent params with corresponding arguments
Parameters:
fmt {string}
: format string, arguments are encoded as %args {any}
: list of arguments to be replaced in %Returns:
{string}
: string with percent parameters substitutedBack to module description.
logger.logx(level, module, id, fmt[, args)
Extended interface to make a generic log message on any level
Parameters:
log {number}
: level as a number (see GLogLevelFlags enum for values)id {task|cfg|pool|string}
: id to logfmt {string}
: format string, arguments are encoded as %args {any}
: list of arguments to be replaced in %Returns:
No return
Back to module description.
logger.log_level()
Returns log level for a logger
Parameters:
No parameters
Returns:
{string}
: current log levelBack to module description.
Back to top.