Logging Options

October 26, 2015 ยท View on GitHub

NkSIP uses Lager for logging, supporting multiple log levels, log rotation, etc. The following Lager levels are used:

LevelTypical use
debugMaximum level of information. Do not use it in production
infoDetailed information. Not recommended in production
noticeImportant information. Recommended in production
warningActions you should take into account
errorImportant internal errors
criticalNot used currently
alertNot used currently
emergencyNot used currently

You can configure Lager using its erlang environment variables, or using an erlang start up configuration file (usually called app.config). See the samples directory for an example of use.

Lager supports several backends, typically console and disk. You can change the current log level with lager:set_loglevel/2,3 (for example lager:set_loglevel(lager_console_backend, debug) and lager:set_loglevel(lager_file_backend, "console.log", debug)).

In order for a Service to change its log level, not only the global log level must be changed, but also the application configuration, using the log_level option. Service config options can be changed on the fly.

To get SIP message tracing, activate the nksip_trace plugin.