MicroStrategy ONE

Handler

Every logger object is associated with a set of log handlers. A handler provides you the ability to send the log message to destinations such as a file, system console or a debugging monitor.

All handlers used by the MicroStrategy Web products are available in the com.microstrategy.utils.log package. The following properties are common to all handlers.

Property Use Default value

level

Specifies the minimum level of log messages that the handler accepts.

OFF

class (required)

Specifies the qualified class name of the handler.

N/A

formatter

Specifies the fully qualified class name of the formatter which should be used to format the log messages.

SimpleFormatter

filter

Specifies the fully qualified class name of a filter which should be used to further sift the log records.

No filter

The following handlers are used by the MicroStrategy Web products:

DatedFileHandler

This handler in the com.microstrategy.utils.log package channels the log message to a file and inserts a time stamp in the name of the log file. The DatedFileHandler has the following additional properties.

Property Use Default value

pattern

Specifies the absolute path of the log file.

A pattern consists of a string that includes the following special components replaced at runtime:

%systemdate%  appends the current date with the following format MMDDYYYY

"/"    the local pathname separator

"%t"   the system temporary directory

"%h"   the value of the "user.home" system property

"%g"   the generation number to distinguish rotated logs, if unspecified, it is automatically appended to the file name

"%u"   a unique number to resolve conflicts

"%%"   translates to a single percent sign "%"

For example, com.microstrategy.utils.log.FileHandler.pattern=%t/log%g.txt generates the following file: c:/temp/log0.txt

[temp folder]/webLog.txt

limit

Specifies the maximum size of a log file.

0 ( 0 implies that there is no limit on the size of the log file)

count

Specifies the maximum number of log files to write. Thus, if count is 5, the logger generates maximum five log files. Once each log file reaches its maximum size, the next log file is used for subsequent logging and so on till five log files are written. After that, the logger starts overwriting the first log file and continue the process.

1. If a count of less than 1 is specified in the logging properties file, the count is set to 1.

append

Once the name of the log file is decided, this setting determines whether to overwrite or appending that file.

false

Example

handlers=fileH

fileH.level=ALL

fileH.class=com.microstrategy.utils.log.DatedFileHandler

fileH.formatter=com.microstrategy.utils.log.XMLFormatter

fileH.append=true

fileH.pattern= C\:/websdk/log/MSTRLog%systemdate%.log

fileH.count=4

fileH.limit=500000

The count and limit above specify that the logger object uses a circular log of four files starting with C:/websdk/log/MSTRLog01012005_1.log. Once this file reaches the specified maximum limit of 50000 bytes, C:/websdk/log/MSTRLog01012005_2.log is created. This is repeated until the fourth file C:/websdk/log/MSTRLog01012005_4.log is full. Once all the four files reach their maximum limit of 50000 bytes, C:/websdk/log/MSTRLog01012005_1.log gets overwritten with new log messages.

Note that the count is maintained for a specific date. That is the count of 4 in the above example is followed for C:/websdk/log/MSTRLog01012005. But for the next day, four new files will be created as C:/websdk/log/MSTRLog01022005, and so on.

ConsoleHandler

This handler in the com.microstrategy.utils.log package channels the log message to the system console.

Example

handlers=consoleH

consoleH.level=ALL

consoleH.class=com.microstrategy.utils.log.ConsoleHandler

consoleH.formatter=com.microstrategy.utils.log.XMLFormatter

DebugMonitorHandler

This handler in the com.microstrategy.utils.log package channels the log message to the debugging monitor. The debugging monitor is available only in Windows. There are many commercial and free versions available. MicroStrategy also provides a simple implementation: C:\Program Files\Common Files\MicroStrategy\Monitor.exe.

Example

handlers= DebugMonD

DebugMonD.level=ALL

DebugMonD.class=com.microstrategy.utils.log.DebugMonitorHandler

DebugMonD.formatter=com.microstrategy.utils.log.XMLFormatter

See also