CONSOLE-LOG.CONF(5)

NAME
console-log.conf - Main configuration file for console-log

DESCRIPTION
console-log keeps logfile pagers open on virtual consoles. /etc/console-log.conf is the configuration file controlling which log file is opened on which tty.

Empty lines and lines starting with a hash sign (#) are ignored.

The rest of the file consists of stanzas composed of lines formed with a single keyword followed by one or more values. Each stanza describes one pager being started. Stanzas are separated by blank lines.

tty The number of the tty the log pager should be started on. Choose a tty that has a virtual console. This is a mandatory setting.

chvt
    If chvt is yes, the system's console will be switched to the tty of this stanza on startup. Default is no.

file
    A list of absolute paths to log files to display. The first file that is either a plain file or a symlink is displayed. The file name must not contain any spaces. This is a mandatory setting.

user, group
    If user and/or group are given, the UID/GID will be changed to the given values before invoking the log pager. User must be in group as defined in /etc/group. If no user is given, the pager will run as the default user/group set at build time. Use caution when specifying privileged users or groups.

maxfilesize
    If the file exceeds the configured size, no pager is started to reduce memory usage. Value is given in bytes. Default is 7000000. The service is started with MemoryMax= twice this value.

locscript
    This option was removed in console-log 2.0. If you used this, please file a bug and describe your use case.

pager
    The program used to display the file. Currently, less is the only supported (and default) pager. It is invoked with secure settings and follow mode activated. The codebase allows for other pagers. Please submit patches to add support via the BTS.

EXAMPLE
The default config file:

tty 9
chvt yes
file /var/log/syslog
group adm
tty 8
file /var/log/exim4/mainlog /var/log/exim/mainlog /var/log/mail.log
group adm

This will start:

•   One pager for the first readable file from /var/log/exim4/mainlog, /var/log/exim/mainlog, or /var/log/mail.log on tty 8.

•   One pager for /var/log/syslog on tty9.

•   The active virtual console will switch to tty9 at boot.

If a file cannot be read by the user specified, the pager will not run. You may:

•   Change the file permissions

•   Adjust log rotation policies

•   Use a different user/group

•   Add the user to the appropriate group (e.g., mail or adm)

The recommended solution is to make the file readable by the default user, as this poses the least security risk.

CONFIGURING THE PAGER
All configuration options are handed to the logpager wrapper script. You can use this to customize your pager. For example, the logpager script sets the LESSSECURE environment variable from less_lesssecure and LESS from less_opts.

This mechanism applies to any pager invoked by logpager.

CONFIGURING THE LESS PAGER
For configuring less, the following options are available:

less_lesssecure
    Sets the LESSSECURE environment variable. Default: 1.

less_follow_name
    Adds --follow-name to the less command line. This may be better in handling log rotation, but might lose the capability to scroll back and to have search results hilighted.

less_opts
    Sets the LESS environment variable. Default: --LONG-PROMPT --chop-long-lines --IGNORE-CASE --jump-target=10 --max-forw-scroll=100 --window=-4 --status-column. To handle log rotation (#111272), add --follow-name. This may become the default in future versions.

less_lesskey
    Sets the LESSKEY environment variable. Default is /usr/lib/console-log/lesskey, which currently does not exist. The variable is only set if the file exists.

less_term
    Sets the TERM environment variable. Default: linux.

SUPPORTING YOUR FAVORITE PAGER
If you want to use a different pager, file a wishlist bug— ideally with a patch. Likely, you just need to create a new file in: src/console_log/pagers

You can model it after less.py. If your pager should be configurable via console-log.conf, prefix configuration variables with your pager name. Example: mypager_mycooloption.

FILES
/etc/console-log.conf

BUGS
Many. Be prepared to debug.

AUTHOR
Marc Haber

THANKS
Thanks to Ivan Frederiks for pointing out less --follow-name.