The rolling file appender enables logging to a file with several backup files. You can configure the maximum amount of disk space that the trace files may use. The rolling file appender works in a single tasking environment (as in the resource adapter) as well as in a multitasking environment (as in the proxy container).
Logging files
The rolling file appender creates the files <File>.gen
and (in a multitasking configuration) <File>.lck
for internal use only and requires these in operation. <File>
is the name of the current logging file, e.g. BeanConnect.logging.txt
. The file in the given example is specified in the configuration file for the BeanConnectShortLoggingFile
appender.
The rolling file appender always writes to the logging file <File>
. At switch-over:
The file
<File>
is copied to a backup file.The file
<File>
is written again.
At switch-over, the oldest existing backup files are deleted when:
After the file is copied, there are more backup files than the value specified for
<MaxNbrBackupFiles>
and<MaxNbrBackupFiles>
is greater than 0.
Specifications in angle brackets (<>
) such as<File>
or <MaxNbrBackupFiles>
are appender properties. For further information, see Predefined logging configuration of a resource adapter and Predefined logging configuration of a proxy .
Example 24 Logging files
In this example, <File>=<Filename>.txt and <MaxNbrBackupFiles>=3
.
Situation before switch-over:
<Filename>.txt | In use |
<Filename>.13.txt | Oldest backup file |
<Filename>.14.txt | |
<Filename>.15.txt | Newest backup file |
At switch-over, <Filename>.txt
is copied to <Filename>.16.txt
, <Filename>.13.txt
is deleted, and <Filename>.txt
is then written again.
Situation after switch-over:
<Filename>.txt | In use |
<Filename>.14.txt | Oldest backup file |
<Filename>.15.txt | |
<Filename>.16.txt | Newest backup file |