Rolling over log files

By default, there is no rollover policy for logging in Adaptive Server Enterprise Web Services. You can create a log rollover policy based on time or on file size.

Time-based policies

You can configure a time-based log policy to roll over at the following intervals:

For example, to create a log policy that rolls over the log files every night at midnight, edit the following line in the logging.properties file:

log4j.appender.P=org.apache.log4j.FileAppender

The new entry should read as follows (on one line):

log4j.appender.FILE=
org.apache.log4j.DailyRollingFileAppender

Size-based policies

You can configure a log policy based on the size of the logging files. For example, to create a log policy that rolls over a log file at 10MB and keeps one backup of the log file, edit the following line in the logging.properties file:

log4j.appender.P=org.apache.log4j.FileAppender

The new entry should read as follows (on one line):

log4j.appender.P=
org.apache.log4j.RollingFileAppender

Logging is implemented in Adaptive Server Enterprise Web Services using the Apache log4j framework. For information on specific log4j parameters, refer to the following Web documentation: http://jakarta.apache.org/log4j/docs/.