Linux "rsyslogd" Command Line Options and Examples
reliable and extended syslogd

Rsyslogd is a system utility providing support for message logging. Support of both internet and unix domain sockets enables this utility to support both local and remote logging. Note that this version of rsyslog ships with extensive documentation in html format.


Usage:

rsyslogd [ -d ] [ -D ] [ -f config file ] [ -i pid file ] [ -n ] [ -N level ] [ -C ] [ -v ]






Command Line Options:

-d
Turns on debug mode. See the DEBUGGING section for more information.
rsyslogd -d ...
-f
Specify an alternative configuration file instead of /etc/rsyslog.conf, which is the default.
rsyslogd -f ...
-i
Specify an alternative pid file instead of the default one. This option must be used if multipleinstances of rsyslogd should run on a single machine. To disable writing a pid file, use the reservedname "NONE" (all upper case!), so "-iNONE".
rsyslogd -i ...
-N
Do a coNfig check. Do NOT run in regular mode, just check configuration file correctness. This optionis meant to verify a config file. To do so, run rsyslogd interactively in foreground, specifying -f<config-file> and -N level. The level argument modifies behaviour. Currently, 0 is the same as notspecifying the -N option at all (so this makes limited sense) and 1 actually activates the code. Later,higher levels will mean more verbosity (this is a forward-compatibility option).
rsyslogd -N ...
-v
SIGNALSRsyslogd reacts to a set of signals. You may easily send a signal to rsyslogd using the following:kill -SIGNAL $(cat /var/run/rsyslogd.pid)Note that -SIGNAL must be replaced with the actual signal you are trying to send, e.g. with HUP. So it thenbecomes:kill -HUP $(cat /var/run/rsyslogd.pid)HUP This lets rsyslogd perform close all open files.TERM , INT , QUITRsyslogd will die.USR1 Switch debugging on/off. This option can only be used if rsyslogd is started with the -d debug option.CHLD Wait for childs if some were born, because of wall'ing messages.SECURITY THREATSThere is the potential for the rsyslogd daemon to be used as a conduit for a denial of service attack. Arogue program(mer) could very easily flood the rsyslogd daemon with syslog messages resulting in the log filesconsuming all the remaining space on the filesystem. Activating logging over the inet domain sockets will ofcourse expose a system to risks outside of programs or individuals on the local machine.There are a number of methods of protecting a machine:1. Implement kernel firewalling to limit which hosts or networks have access to the 514/UDP socket.2. Logging can be directed to an isolated or non-root filesystem which, if filled, will not impair themachine.3. The ext2 filesystem can be used which can be configured to limit a certain percentage of a filesystemto usage by root only. NOTE that this will require rsyslogd to be run as a non-root process. ALSONOTE that this will prevent usage of remote logging on the default port since rsyslogd will be unableto bind to the 514/UDP socket.4. Disabling inet domain sockets will limit risk to the local machine.Message replay and spoofingIf remote logging is enabled, messages can easily be spoofed and replayed. As the messages are transmitted inclear-text, an attacker might use the information obtained from the packets for malicious things. Also, anattacker might replay recorded messages or spoof a sender's IP address, which could lead to a wrong perceptionof system activity. These can be prevented by using GSS-API authentication and encryption. Be sure to thinkabout syslog network security before enabling it.DEBUGGINGWhen debugging is turned on using the -d option, rsyslogd produces debugging information according to theRSYSLOG_DEBUG environment variable and the signals received. When run in foreground, the information is writ‐ten to stdout. An additional output file can be specified using the RSYSLOG_DEBUGLOG environment variable.FILES/etc/rsyslog.confConfiguration file for rsyslogd. See rsyslog.conf(5) for exact information./dev/logThe Unix domain socket to from where local syslog messages are read./var/run/rsyslogd.pidThe file containing the process id of rsyslogd.prefix/lib/rsyslogDefault directory for rsyslogd modules. The prefix is specified during compilation (e.g. /usr/local).ENVIRONMENTRSYSLOG_DEBUGControls runtime debug support. It contains an option string with the following options possible (allare case insensitive):Debug Turns on debugging and prevents forking. This is processed earlier in the startup than commandline options (i.e. -d) and as such enables earlier debugging output. Mutually exclusive withDebugOnDemand.DebugOnDemandEnables debugging but turns off debug output. The output can be toggled by sending SIGUSR1.Mutually exclusive with Debug.LogFuncFlowPrint out the logical flow of functions (entering and exiting them)FileTraceSpecifies which files to trace LogFuncFlow. If not set (the default), a LogFuncFlow trace isprovided for all files. Set to limit it to the files specified.FileTrace may be specified multi‐ple times, one file each (e.g. export RSYSLOG_DEBUG="LogFuncFlow FileTrace=vm.c File‐Trace=expr.c"PrintFuncDBPrint the content of the debug function database whenever debug information is printed (e.g.abort case)!PrintAllDebugInfoOnExitPrint all debug information immediately before rsyslogd exits (currently not implemented!)PrintMutexActionPrint mutex action as it happens. Useful for finding deadlocks and such.NoLogTimeStampDo not prefix log lines with a timestamp (default is to do that).NoStdOutDo not emit debug messages to stdout. If RSYSLOG_DEBUGLOG is not set, this means no messageswill be displayed at all.Help Display a very short list of commands - hopefully a life saver if you can't access the documen‐tation...RSYSLOG_DEBUGLOGIf set, writes (almost) all debug message to the specified log file in addition to stdout.RSYSLOG_MODDIRProvides the default directory in which loadable modules reside.BUGSPlease review the file BUGS for up-to-date information on known bugs and annoyances.Further InformationPlease visit http://www.rsyslog.com/doc for additional information, tutorials and a support forum.
rsyslogd -v ...