Supported Platforms
Examples: Configuring System Logging
The following example shows how to configure the
logging of messages about all commands entered by users at the CLI
prompt or invoked by client applications such as Junos XML protocol
or NETCONF client applications, and all authentication or authorization
attempts, both to the file cli-commands
and to the terminal of any user who is logged in:
The following example shows how to configure the
logging of all changes in the state of alarms to the file /var/log/alarms
:
The following example shows how to configure the handling of messages of various types, as described in the comments. Information is logged to two files, to the terminal of user alex, to a remote machine, and to the console:
The following example shows how to configure the handling of messages generated when users issue Junos OS CLI commands, by specifying the interactive-commands facility at the following severity levels:
- info—Logs a message when users issue
any command at the CLI operational or configuration mode prompt. The
example writes the messages to the file
/var/log/user-actions
. - notice—Logs a message when users issue the configuration mode commands rollback and commit. The example writes the messages to the terminal of user philip.
- warning—Logs a message when users issue
a command that restarts a software process. The example writes the
messages to the console.[edit system]syslog {file user-actions {interactive-commands info;}user philip {interactive-commands notice;}console {interactive-commands warning;}}