|
| LuaLogging |
| A simple API to use logging
features in Lua |
home · manual · example
· console · email ·
file · socket
· sql
Email appender
This appender can be used to send log requests through email. One
email message is sent for each log request. This is usually used to
log error events.
function logging.email {
from = string,
rcpt = string or string-table,
[user = string,]
[password = string,]
[server = string,]
[port = number,]
[domain = string,]
[headers = table,]
[logPattern = string,]
}
from:
The sender of the email message.
rcpt:
The recipient of the email message
user:
User for authentication.
password:
Password for authentication.
server:
Server to connect to. Default is "localhost".
port:
Port to connect to. Default is 25.
domain:
Domain name used to greet the server. Defaults to the local
machine host name.
headers.to:
The recipient of the message, as an extended description.
headers.from:
The sender of the message, as an extended description.
headers.subject:
The subject of the message sent. This can contain patterns like
the logPattern parameter.
logPattern:
A pattern can be specified to control how the message is
written.
The default value is "%date %level %message\n".
Example
require"logging.email"
local logger = logging.email {
rcpt = "mail@host.com",
from = "mail@host.com",
{
subject = "[%level] logging.email test",
}, -- headers
}
logger:info("logging.sql test")
logger:debug("debugging...")
logger:error("error!")
$Id: index.html,v 1.1 2004/11/16 16:33:10 tuler Exp
$