.TH CONSOLE-LOG.CONF 5 2025-06-23 "" "console-log" .SH NAME console\-log.conf \- Main configuration file for console\-log .SH DESCRIPTION console-log keeps logfile pagers open on virtual consoles. .I /etc/console\-log.conf is the configuration file controlling which log file is opened on which tty. .PP Empty lines and lines starting with a hash sign (#) are ignored. .PP 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. .PP .TP .B 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. .TP .B chvt If .B chvt is .I yes, the system's console will be switched to the tty of this stanza on startup. Default is .I no. .TP .B 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. .TP .B user, group If .B user and/or .B 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 .I /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. .TP .B 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 .BR MemoryMax = twice this value. .TP .B locscript This option was removed in console-log 2.0. If you used this, please file a bug and describe your use case. .TP .B pager The program used to display the file. Currently, .B 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. .SH EXAMPLE The default config file: .PP .nf 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 .fi .PP This will start: .IP \(bu 2 One pager for the first readable file from .I /var/log/exim4/mainlog, .I /var/log/exim/mainlog, or .I /var/log/mail.log on tty 8. .IP \(bu One pager for .I /var/log/syslog on tty9. .IP \(bu The active virtual console will switch to tty9 at boot. .PP If a file cannot be read by the user specified, the pager will not run. You may: .IP \(bu 2 Change the file permissions .IP \(bu Adjust log rotation policies .IP \(bu Use a different user/group .IP \(bu Add the user to the appropriate group (e.g., mail or adm) .PP The recommended solution is to make the file readable by the default user, as this poses the least security risk. .SH CONFIGURING THE PAGER All configuration options are handed to the .B logpager wrapper script. You can use this to customize your pager. For example, the .B logpager script sets the .B LESSSECURE environment variable from .B less_lesssecure and .B LESS from .B less_opts. .PP This mechanism applies to any pager invoked by .B logpager. .SH CONFIGURING THE LESS PAGER For configuring .B less, the following options are available: .TP .B less_lesssecure Sets the .B LESSSECURE environment variable. Default: 1. .TP .B less_follow_name Adds .B \-\-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. .TP .B less_opts Sets the .B LESS environment variable. Default: .B --LONG-PROMPT .B --chop-long-lines .B --IGNORE-CASE .B --jump-target=10 .B --max-forw-scroll=100 .B --window=-4 .B --status-column. To handle log rotation (#111272), add .B --follow-name. This may become the default in future versions. .TP .B less_lesskey Sets the .B LESSKEY environment variable. Default is .I /usr/lib/console\-log/lesskey, which currently does not exist. The variable is only set if the file exists. .TP .B less_term Sets the .B TERM environment variable. Default: .I linux. .SH 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: .B src/console_log/pagers .PP You can model it after .B less.py. If your pager should be configurable via .I console-log.conf, prefix configuration variables with your pager name. Example: .B mypager_mycooloption. .SH FILES .I /etc/console\-log.conf .SH BUGS Many. Be prepared to debug. .SH AUTHOR Marc Haber .SH THANKS Thanks to Ivan Frederiks for pointing out .B less --follow-name.