Examples: Configure System Logging
Configure how various types of messages are handled, as described in the comments. Information is logged to two files, a remote machine, the terminal of user
alex, and to the console:[edit system]syslog {/* write all security-related messages to file "security" */file security {authorization info;interactive-commands info;}/* write messages about potential problems to file "messages": messages *//* from "authorization" facility at level "notice" and above, messages from *//* all other facilities at level "warning" and above */file messages {authorization notice;any warning;}/* write all messages at level "critical" and above to terminal of user "alex" if she *//* is logged in */user alex {any critical;}/* write all messages from the "daemon" facility at level "info" and above, and messages *//* from all other facilities at level "warning" and above, to the machine junipero.berry.net */host junipero.berry.net {daemon info;any warning;}/* write all messages at level "error" or above to the system console */console {any error;}}Configure the handling of messages generated when users issue JUNOS CLI commands, as described in the comments:
[edit system]syslog {/* write messages to file "user-actions" when users issue any CLI command */file user-actions {interactive-commands info;}/* write messages to terminal of user "philip" when users issue "rollback"*//* or "commit" command */user philip {interactive-commands notice;}/* write messages to console when users issue commands that restart *//* a JUNOS software process*/console {interactive-commands warning;}Write messages about all CLI commands entered by users, and all authentication or authorization attempts to the file
cli-commandsand to the terminal of any user who is logged in:[edit system]syslog {file cli-commands {interactive-commands info;authorization info;}user * {interactive-commands info;authorization info;}Write all changes to the state of alarms to the file
alarms:[edit system]syslog {file alarms {kernel warning;}}