Configure Archiving of Log Files
By default, the JUNOS logging facility stops writing messages to a log file when the file reaches 128 KB in size. It closes the file and adds a numerical suffix, then opens and directs messages to a new file with the original name. By default, it creates up to 10 files before it begins overwriting the contents of the oldest file. The logging utility by default also limits the users who can read log files to the
rootuser and users who have the JUNOSmaintenancepermission.To configure different values that apply to all log files, include the
archivestatement at the[edit system syslog]hierarchy level:[edit system syslog]archive {filesnumber;sizesize;(world-readable | no-world-readable);}To configure different values that apply to a particular log file, include the
archivestatement at the[edit system syslog filefilename]hierarchy level:[edit system syslog]filefilename{facility level;archive {filesnumber;sizesize;(world-readable | no-world-readable);}}To specify the number of files to create, set the
filesstatement to a value from1through1000.To specify the maximum size of each file, set the
sizestatement to a value from 64 KB (64k) through 1 GB (1g).To enable all users to read log files, include the
world-readablestatement. To restore the default permissions, include theno-world-readablestatement.