dmlogger - inserts collected log messages into database
dmlogger --help
dmlogger --version
dmlogger --database file --node id [--minlevel n] [--ipc] [--verbose]
dmlogger --config file [--name name]
The dmlogger program collects log messages from a POSIX message queue and
inserts them into a SQLite database. The name of the message queue matches the
given dmlogger name, by default /dmlogger
.
If a minimum log level is selected, only logs of a level greater equal the minimum are stored in the database. Log messages with lower level are discarded.
The option --ipc
enables process synchronisation via POSIX semaphores. The
semaphore value is incremented from 0 to 1 whenever a new log has been
delivered. The name of the semaphore equals the dmlogger name with leading
/
. Only a single process shall wait for the semaphore unless round-robin IPC
is desired. This option may be used to synchronise incoming log messages
automatically with a remote RPC API server. For example, pass the dmlogger
name to dmsync(1) through command-line argument --wait
. The semaphore will
then trigger the log synchronisation.
- --config, -c file
-
Path to configuration file.
- --database, -d file
-
Path to SQLite log database.
- --help, -h
-
Output available command-line arguments and quit.
- --ipc, -Q
-
Use POSIX semaphore for process synchronisation. The name of the semaphore matches the instance name (with leading slash). The semaphore is set to 1 each time a log message has been received. Only a single process shall wait for this semaphore.
- --minlevel, -L level
-
Minimum level for a log to be stored in the database, from 1 (
LL_DEBUG
) to 5 (LL_CRITICAL
). The argument may be an integer or name string. - --name, -n name
-
Name of logger instance, configuration, POSIX message queue, and POSIX semaphore (default is
dmlogger
). - --node, -N id
-
Node id.
- --verbose, -V
-
Print received logs to stdout.
- --version, -v
-
Output version information and quit.
Create a POSIX message queue /dmlogger
and wait for incoming logs:
$ dmlogger --node dummy-node --database /var/dmpack/log.sqlite --minlevel info
Received logs are inserted only if they are of level info or higher.
Project web site: https://www.dabamos.de/