110
Chapter 12
Working with Log Files
•
The suffix
.old
that makes it easy for automated scripts to find rolled log files
The time stamps have the following format:
%Y%M%D.%Hh%Mm%Ss-%Y%M%D.%Hh%Mm%Ss
where:
The following is an example of a rolled log file name:
squid.log.mymachine.20000912.12h00m00s-20000913.12h00m00s.old
When a log file is rolled, the log buffer might be partially full. If so, the first entry in the new log file will have
a time stamp earlier than the time of rolling. When the new log file is rolled, its time stamp will be the time
stamp of the first entry. For example, suppose logs are rolled every 3 hours, and the first rolled log file is:
Log file 1:
squid.log.mymachine.19980912.12h00m00s-19980912.03h00m00s.old
If the first entry in the log buffer at 3:00:00 has a time stamp of 2:59:47, the next log file, when rolled, will
have the following time stamp:
Log file 2:
squid.log.mymachine.19980912.02h59m47s-19980912.06h00m00s.old
The beginning time stamp of a rolled log file is the time stamp of its first entry; the ending time stamp is the
time of log rolling. The contents of a log file are always between the two time stamps. Log files do not contain
overlapping entries, even if successive time stamps appear to overlap.
Rolling intervals
Log files are rolled at specific intervals relative to a given hour of the day. Two options control when log files
are rolled:
•
The rolling interval
•
The offset hour, which is an hour between 0 (midnight) and 23
For example, if the rolling interval is 6 hours and the offset hour is 0 (midnight), then the logs will roll at
midnight (00:00), 06:00, 12:00, and 18:00 each day. If the rolling interval is 12 hours and the offset hour is 3,
then logs will roll at 03:00 and 15:00 each day.
Setting log file rolling options
You can set log file rolling options by using Traffic Manager or by editing a configuration file manually. Both
procedures are provided below.
To set log file rolling options from Traffic Manager:
1. Access Traffic Manager from your browser (refer to
Accessing Traffic Manager‚ on page 8
).
2. On the Configure tab, click the Logging button.
Code
Definition
Example
%Y
the year in four-digit format
2000
%M
the month in two-digit format, from 01-12
07
%D
the day in two-digit format, from 01-31
19
%H
the hour in two-digit format, from 00-23
21
%M
the minute in two-digit format, from 00-59
52
%S
the second in two-digit format, from 00-59
36