LuaLogging
A simple API to use logging features in Lua

Socket appender

This appender can be used to send log requests through a socket. Socket appender relies on LuaSocket to do its job.
Upon each log request a connection is opened, the message is sent and the connection is closed.
function logging.socket(address, port [,logPattern])
  • address:
    Address can be an IP address or a host name for which the log message will be sent.
  • port:
    The port must be an integer number in the range [1..64K).
  • logPattern:
    A pattern can be specified to control how the message is written.
    The default value is "%date %level %message\n".

Example

require"logging.socket"
local logger = logging.socket("localhost", 5000)
logger:info("logging.socket test")
logger:debug("debugging...")
logger:error("error!")

 

 

 

 

Valid XHTML 1.0!

$Id: socket.html,v 1.9 2007/10/30 19:57:59 carregal Exp $