Creates and maintains fixed-size log files created from standard input.
alog -f LogFile [ -o ]
alog -f LogFile | [ [ -q ] [ -s Size ] ]
alog -t LogType -V
alog -C -t LogType [ -f LogFile ] [ -s Size ] [ -w Verbosity ]
alog -L [ -t LogType ]
The alog command reads standard input, writes to standard output, and copies the output into a fixed-size file. This file is treated as a circular log. If the file is full, new entries are written over the oldest existing entries.
The alog command works with log files that are specified on the command line or with logs that are defined in the alog configuration database. Logs that are defined in the alog configuration database are identified by LogType. The File, Size, and Verbosity attributes for each defined LogType are stored in the alog configuration database with the LogType. You can add a new LogType to the alog configuration database using the odmadd command. You can change the attributes of LogType defined in the alog configuration database using the alog command.
|-C||Changes the attributes for a specified LogType. Use the
-C flag with the -f, -s, and -w
flags to change the File, Size, and Verbosity
attributes for the specified LogType. The -t
LogType flag is required.
When the -C flag is used to modify the attributes for the console log type, the console log file is also modified and the console device driver is updated to use the new values. This is a deviation from the normal operation of alog -C and is done to accommodate special formatting in the console log file.
Note: You must have root user authority to change alog attributes.
|-f LogFile||Specifies the name of a log file. If the specified LogFile does not exist, one is created. If the alog command is unable to write to LogFile, it writes to /dev/null. Use the -f LogFile flag with the -C and -t flags to change the File attribute for a LogType defined in the alog configuration database.|
|-L||Lists the log types currently defined in the alog configuration
database. If you use the -L flag with the -t
LogType flag, the attributes for a specified LogType are
listed. The current values of the File, Size, and
Verbosity attributes are listed as colon separated values:
|-o||Lists the contents of LogFile. Writes the contents of LogFile to standard output in sequential order.|
|-q||Copies standard input to LogFile but does not write to standard output.|
|-s Size||Specifies the LogFile size limit in bytes. The space
for LogFile is reserved when it is created. If you create a
new LogFile and do not specify the Size attribute, the
minimum LogFile size, 4096 bytes, is used. If
LogFile already exists, its size will be changed. The size
you specify is rounded upward to the next integral multiple of 4096
bytes. If you decrease the size of LogFile, the oldest
entries in the log are deleted if they do not fit within the new size
limit. You must have write permission for LogFile to change
Use the -s Size flag with the -C and the -t flags to change the Size attribute for LogType defined in the alog configuration database. The new Size attribute value is used the next time LogFile is created.
|-t LogType||Identifies a log defined in the alog configuration database. The alog command gets the log's file name and size from the alog configuration database. If LogFile does not exist, one is created.|
|-V||Writes the current value of the Verbosity attribute for
LogType that is defined in the alog configuration database to
standard output. If you do not specify LogType, or the
LogType you specify is not defined, nothing is written to standard
The value output using the alog command with the -t LogType and the -V flags can be used by a command that is piping its output to the alog command to control the verbosity of the data it writes to the pipe.
|-w Verbosity||Changes the Verbosity attribute for LogType defined
in the alog configuration database when used with the -C and the
The Verbosity attribute can have a value from 0 to 9. If the value is 0, no information is copied to LogFile by the alog command. All of the information is still written to standard output. If the value is not 0, all of the information piped to the alog command's standard input is copied to LogFile and to standard output.
date | alog -f /tmp/sample.log
alog -f /tmp/sample.log -o
echo "resizing log file" | alog -f /tmp/sample.log -s 8192
SWservAt: attribute="alog_type" deflt="sample" value="sample"
SWservAt: attribute="sample_logname" deflt="/tmp/sample.log" value="/tmp/sample.log"
SWservAt: attribute="sample_logsize" deflt="4096" value="4096"
SWservAt: attribute="sample_logverb" deflt="1" value="1"
After creating the alog.add file, enter:
This adds the alog.add file to the SWservAt database.
alog -C -t sample -f /var/sample.log
|/etc/objrepos/SWservAt||Software Service Aids Attributes Object Class|
The odmadd command.
How to Add Objects to an Object Class in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.