util.logger

Prosody's logger library allows you to easily generate log messages, or catch such messages, possibly according to specified criteria.

Note: Prosody plugins already have a logger initialised for them… see "Developing modules: Logging".

Reference

logger.init(name)

Returns a log() function for the specified source. name may be any short descriptive string, preferably unique. Commonly it is the name of your module.

logger.setwriter(writer)

Accepts a function which will be used for output of all log messages. A writer function looks like this:

function mywriter(source, level, message, ...)
 
end