Directing Messages to a Log File
To direct system log messages to a file on the local disk of the local Routing Engine, include the
filestatement at the[edit system syslog]hierarchy level:[edit system syslog]filefilename{facility severity;explicit-priority;match "regular-expression";archive {filesnumber;sizesize;(world-readable | no-world-readable);}}The default directory for log files is
/var/log; to specify a different directory on the local Routing Engine's local disk, include the complete pathname. For the list of logging facilities and severity levels, see Table 7 and Table 8.To prevent log files from growing too large, the JUNOS system logging utility by default writes messages to a sequence of files of a defined size. By including the
archivestatement, you can configure the number of files, their maximum size, and who can read them, for either all log files or a certain log file. For more information, see Configuring Log File Archiving.For information about the
explicit-prioritystatement, see Including Priority in System Log Messages.For information about the
matchstatement, see Using Regular Expressions to Refine the Set of Logged Messages.