log-prefix M120;
}
When these configuration statements are included on an M120 router called origin1, a
message in the system log on hardware-logger.mycompany.com looks like the following:
Mar 9 17:33:23 origin1 M120: mgd[477]: UI_CMDLINE_READ_LINE: user ‘root’, command ‘run
show version’
Configuring the Size and Number of Log Files
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. The files in the sequence are
referred to as archive files to distinguish them from the active file to which messages are
currently being written. The default maximum size depends on the platform type:
•
128 kilobytes (KB) for J Series Services Routers
•
1 megabyte (MB) for M Series, MX Series, and T Series routing platforms
When an active log file called logfile reaches the maximum size, the logging utility closes
the file, compresses it, and names the compressed archive file logfile.0.gz. The logging
utility then opens and writes to a new active file called logfile. When the new logfile
reaches the configured maximum size,logfile.0.gz is renamed logfile.1.gz, and the new
logfile is closed, compressed, and renamed logfile.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 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 the root user and users who have the Junos
maintenance permission.
You can include the archive statement 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 the archive statement at the [edit system syslog] hierarchy level:
[edit system syslog]
archive {
files number;
size size;
(world-readable | no-world-readable);
}
To configure values that apply to a particular log file, include the archive statement at
the [edit system syslog file filename] hierarchy level:
[edit system syslog file filename]
facility severity;
archive {
files number;
size size;
(world-readable | no-world-readable);
}
files number specifies the number of files to create before the oldest file is overwritten.
The value can be from 1 through 1000.
17Copyright © 2010, Juniper Networks, Inc.
Chapter 1: Configuring System Log Messages