Simple rsyslog Configuration

This configuration uses a simple approach to logging which separates log lines into different files based on application name. This approach has the benefit that it allows logging to any desired syslog facility and will prevent non-MythTV application logging from getting into MythTV log files (even if another service or application uses the same syslog facility). This configuration assumes that all MythTV applications use syslog logging. This is done by specifying the command-line argument --syslog <facility> to all MythTV applications, for example:

mythbackend --syslog local7

To use the configuration, place the configuration file at /etc/rsyslog.d/40-mythtv.conf, create/update the initial log files with appropriate ownership and permissions, restart rsyslogd, then start MythTV applications with --syslog local7. The commands to create/update the initial log files are given, below, for easier copy/paste (permissions, here, are appropriate for Ubuntu-based systems--change owner and group, as required, for your system):

Example configuration file for using rsyslog for MythTV application logging.

Supports

In versions 0.26 and above, Mythlogserver handles all logging requests.

Each log entry would have the program name: mythlogserver before the
name of the program that called for the log.
The MythTVLog template in the following file removes the mythlogserver text.

Note: By default, log entries will have control codes converted to
their octal values (e.g. new-lines will show up as #012.) The conversion
can be prevented by adding $EscapeControlCharactersOnReceive off
to the following file.
This, however, affects ALL syslog logging, not just MythTV.
See warnings here.

The following is an example of a typical MythTV multi-line message
as it appears in the log file:

... CoreContext main.cpp:748 (main) #012===============================================================#012| Attempting to contact the master backend for rescheduling. |#012| If the master is not running, rescheduling will happen when |#012| the master backend is restarted. |#012===============================================================

By adding the $EscapeControlCharactersOnReceive off in the file below, the above will
print in its intended format:

... CoreContext main.cpp:748 (main)
===============================================================
| Attempting to contact the master backend for rescheduling. |
| If the master is not running, rescheduling will happen when |
| the master backend is restarted. |
===============================================================