The remotelog
is a Lua module that provides logging capabilities. While it supports regular logging to STDOUT
too,
it is mainly targeted at systems where a log receiver must be on a different machine, especially when debugging problems
in server processes.
The module is designed to be easily usable, compact and fast. It was originally created to allow remote logging from Lua scripts running inside an Exasol database, but works in other context as well.
The following snippet demonstrates basic remote logging. Check the user guide for more details.
local log = require("remotelog")
log.connect("thehost.example.org", 3000)
log.info("Hello world.")
log.disconnect()
- Logging to
STDOUT
- Logging to remote log receiver via a TCP socket
- Configurable automatic fallback in case socket connection cannot be established
- Log level control
- Configurable timestamp format
- Optional high-resolution timer
remotelog
requires Lua 5.1 or later.
Dependency | Purpose | License |
---|---|---|
LuaSocket | Socket communication | MIT License |
Note that LuaSucket is pre-installed on an Exasol database. For local unit testing you need to install it on the test machine though.
Dependency | Purpose | License |
---|---|---|
luaunit | Unit testing framework | BSD License |
Mockagne | Mocking framework | MIT License |
Dependency | Purpose | License |
---|---|---|
LuaRocks | Package management | MIT License |