Configuring Log File Archiving
For each log file
logfilethat you configure,the JUNOS logging utility writes a specified maximum amount of data to the file. The default maximum depends on the platform type:
- 128 kilobytes (KB) for J-series Services Routers
- 1 megabyte (MB) for M- and T-series routing platforms
- 10 MB for TX Matrix platforms
When the file reaches the maximum size, the logging utility closes the file, compresses it, and names the compressed file
logfile.0.gz. The logging utility then opens and writes to a new file calledlogfile. When the newlogfilereaches the configured maximum size,logfile.0.gzis renamedlogfile.1.gz, and the newlogfileis closed, compressed, and renamedlogfile.0.gz.By default, the logging utility creates up to 10 archive files in this manner. When the maximum number of archive files is reached, each time the active log file reaches the maximum size the contents of the oldest archive file are lost (overwritten by the next oldest file). The logging utility by default also limits the users who can read log files to therootuser and users who have the JUNOSmaintenancepermission.You can include the
archivestatement in the configuration to change the maximum size of each file, how many archive files are created, and who can read log files. To configure values that apply to all log files, include thearchivestatement at the[edit system syslog]hierarchy level:[edit system syslog]archive {filesnumber;sizesize;(world-readable | no-world-readable);}To configure values that apply to a particular log file, include the
archivestatement at the[edit system syslog filefilename]hierarchy level:[edit system syslog filefilename]facility severity;archive {filesnumber;sizesize;(world-readable | no-world-readable);}The number of files specified with the
filesstatement can range from1through1000. The maximum file size specified with thesizestatement can range from 64 KB (64k) through 1 gigabyte (1g); to represent megabytes, use the lettermafter the integer. To enable all users to read log files, include theworld-readablestatement. To restore the default permissions, include theno-world-readablestatement.