Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

[Part 1 | OLAP Data Access Logging: Part 1 - Introduction and basic settings] - Introduction and basic settings
[Part 2 | OLAP Data Access Logging: Part 2 - Modules and Components] - Modules and Components
[Part 3 | OLAP Data Access Logging: Part 3 - API call timings] - API call timings
[Part 4 | OLAP Data Access Logging: Part 4 - Query logging] - Query logging
Part 5 - Log Formatting
[Part 6 | OLAP Data Access Logging: Part 6 - Assertions, Unix and 64 bit Windows] - Assertions, Unix and 64 bit Windows
[Part 7 | OLAP Data Access Logging: Part 7 - Choosing the correct settings and example defaults] - Choosing the correct settings and example defaults

Full article also available in SDN's Article section here.

h1. Formatting Logs

The default format for a line in the OLAP Data Access logs contains a time stamp, the module name, the component name and then finally the information being logged. It is possible to configure the format of the logs and add additional information.

The format of log lines is controlled through the LogFormat string registry value located in the root Log folder. If the registry value is missing the format will revert to the default. The format of the log is defined by a series of tokens which can be wrapped in other text.

h2. Formatting tokens

The following table shows a list of tokens available.

Token

Description

%C

Display the name of the component

%c

Display the name of the component

%D

Display the date

%d

Display the date

%F

Display the full path and filename of the source file where the information being logged originated.

%f

Display the filename of the source file where the information being logged originated.

%I

Display thread ID.

%i

Display thread ID.

%L

Display the line number of the source file where the information being logged originated

%l

Display the line number of the source file where the information being logged originated

%N

Display the name of the function logging the current information

%n

Display the name of the function logging the current information

%M

Display the logging message where non-alpha numeric characters are converted to character codes so that, for example, the message can be embedded in XML or HTML

%m

Display the logging message

%T

Display the date and time

%t

Display the date and time in ISO8601 format

%X

Display the name of the module

%x

Display the name of the module

%V

Display the verbosity at which the information is being logged at

%v

Display the verbosity at which the information is being logged at

So, for example, the following value for LogFormat

bq.

%t %I %X %C %V %n %M


Which would look like the following in an MDA 12 registry:

bq.

[HKEY_LOCAL_MACHINESOFTWAREBusiness ObjectsSuite 12.0MDALog]

"LogFormat"="%t %I %X %C %V %n %M"


Would produce a log output as follows

bq.

2009-12-04T14:02:13.720 7904 MEMORY String INFO ComponentLog::log Instance 0 (1F78B5E0): Created

2009-12-04T14:02:13.720 7904 APIMODULE ConnectionManagerImpl EXTRA olap_api::ApiLogger::traceLog ConnectionManagerImpl::getDrivers

2009-12-04T14:02:13.728 7904 SUPPORT Synchronization DEBUG support_dll::TasmanVerboseSynchronized::log_locking Thread ID 7904 : locking ProviderBrowse::m_sProviderDetailsMutex[0] mutex

2009-12-04T14:02:13.732 7904 ODBOSHAREDUTILITIES ODBOPROVIDERENUMERATOR EXTRA ComponentLog::log CoCreateInstance(CLSID_OLEDB_ENUMERATOR, NULL, CLSCTX_ALL, IID_ISourcesRowset, pISrcRowset(0x00000000))


The token %t outputs the time and date in ISO8601 format. The token *%I *outputs the thread ID, in this case the thread ID is 7904.

The token %X outputs the module name. This is MEMORY for the first line, *APIMODULE *for the second, SUPPORT for the third and ODBOSHAREDUTILITIES for the fourth line.

The token %C outputs the component name. This is String for the first line, ConnectionManagerImpl for the second line, Synchronization for the third line, and ODBOPROVIDERENUMERATOR for the fourth line.

The token %V outputs the verbosity. The values are INFO, EXTRA, DEBUG and EXTRA for the four lines respectively.

The token %n displays the name of the function doing the logging. The values are ComponentLog::log, olap_api::ApiLogger::traceLog, support_dll::TasmanVerboseSynchronized::log_locking, and ComponentLog::log for the four lines respectively. As may be apparent, these function names have names related to logging rather than another functional aspect of the OLAP Data Access component. This is because much of the lines of code that actually do the logging have been factored into common functions. This means that facilities like logging the function name, or logging the source file name and source code line will generally just log one of a handful of core logging function names and locations. This is obviously of limited diagnostic value, will take up additional disk space and add an additional performance overhead so they are not recommended settings to use.

Finally the token %M logs the message.

Non alpha numeric character encoding

If the token used to display message is %M rather than %m then certain characters will be converted as illustrated in the following table.

Character

Conversion

<

>

&

&

&apos

"

&quote