Thursday, July 4, 2013

#3 ODI as windows service, Wrapper log file issue

I got a mail saying that in one of my servers the D drive space is 90% full.
When I checked the drive, I found that a single log file called wrapper.log.0 file was 85 GB.!!

The path of the file was D:\Oracle\product\11.1.1\Oracle_ODI\oracledi\agent\bin

When analyzed what created this log file, came up with the below details:

YAJSW(Yet Another Java Service Wrapper) is used to run the ODI Stand Alone Agent as a windows service.  (refer to http://yajsw.sourceforge.net/)
The console logging data is saved in wrapper.log file.
When this file grows to huge size, the disk compression utility in Windows adds a .0 file extension to increase the amount of information a user could save to a hard drive.

The configuration file for this wrapper in wrapper.conf. This has the wrapper logging properties.

A Sample extract from the conf file will look like :

#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console. (See docs for formats)
wrapper.console.format=M

# Log Level for console output. (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=logs/wrapper.log

# Format of output for the log file. (See docs for formats)
wrapper.logfile.format=M

# Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
# the log is rolled. Size is specified in bytes. The default value
# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
# 'm' (mb) suffix. For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=0

# Maximum number of rolled log files which will be allowed before old
# files are deleted. The default value of 0 implies no limit.
wrapper.logfile.maxfiles=0
-------------------------------------------------------------------------


 Usually the log properties should be set for rolling if we want them to be refreshed daily instead of piling up.
wrapper.logfile.maxsize sets the maximum size for the wrapper.log file
wrapper.logfile.maxfiles sets the maximum number of log files to be rolled to.

Based on the rolling options of the log file, it will append .1, .2...and so on after the file.

So in the above case we can see that both the properties were set to 0.
Since there was no option set to limit the maximum size of the file, this file was growing in size and as the rolling of the log file option was also not set, it was growing in a single file.

Solution: I set the properties as:

wrapper.logfile.maxsize=512m
 wrapper.logfile.maxfiles=10

This solved the problem.

No comments:

Post a Comment