Module optivo.common.log4lua.appenders.smtp
SMTP appender sending the log messages as an email.
This appender requires LuaSocket.
Configuration
This appender takes a table formatted according to socket.smtp as smtp/email configuration. The table must be like this: local params = {
headers = {
from = "sender@domain.tld",
to = "recipient@domain.tld",
subject = "May contain placeholders like %LEVEL, %MESSAGE and so on"
},
body = "The body of the message. May contain placeholders like %LEVEL, %MESSAGE and so on."
} If params.headers.subject or params.body Log level threshold
In order to be able to use the smtp appender even for categories configured to levelDEBUG a level threshold is used. Only messages higher or equal than that threshold will be send.
Release: $Date: 2008-09-06 03:57:01 +0200 (Sa, 06 Sep 2008) $ $Rev: 68 $
Functions
| new (mail, levelThreshold, smtpHost, smtpPort, smtpUser, smtpPassword, smtpImpl) | An appender that sends emails. |
Functions
- new (mail, levelThreshold, smtpHost, smtpPort, smtpUser, smtpPassword, smtpImpl)
-
An appender that sends emails.
Parameters
- mail: a table containing the smpt and mail configuration
- levelThreshold: (optional) a level constant (logger.DEBUG, logger.WARN etc.) If given then only messages with a higher or equal level are sent.
- smtpHost: optional
- smtpPort: optional
- smtpUser: optional
- smtpPassword: optional
- smtpImpl: is only used in tests and defaults to socket.smtp