Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Defining the CDB properties file


properties file

CDB is configured using the properties file called cdb.properties. This file is provided when you install the CDB. Series of default values are set to allow the tool to work when you install it. The properties file can be modified to customise to the requirement.

Install the CDB in epoc32\tools, which is the default location. The properties file will be created and defined in epoc32\tools\cdb.

The set of properties in the properties file looks like this:

# general tool settings, where it can find basic things it needs
cdb.env.cppfilt = ${cdb.env.epoc32tree}gcc\\bin\\c++filt.exe
cdb.env.cppfilt.eabi = ${cdb.env.epoc32tree}tools\\cdb\\c++filt.exe
cdb.env.debug = false
    
# Database Configuration
cdb.db.script = ${cdb.env.epoc32tree}tools\\cdb\\cdb.sql
cdb.db.path = ${cdb.env.epoc32tree}data\\cdb.db
cdb.db.type = HSQLDB

# Extraction Settings
cdb.extract.gxp.path = ${cdb.env.epoc32tree}release\\gccxml\\urel\\
cdb.extract.def.type = EABI
cdb.extract.classdoc
# ${cdb.env.epoc32tree}data\\apiclassdoc.xml
# if not set, extracted data is not classified. 

# Log File Settings
cdb.log.file.enabled = false
cdb.log.file.format = %-5p [%-20.20C{1}] %-8r %4L - %m%n
cdb.log.file.path = d:\\code\\cdb\\data\\cdb.log
cdb.log.file.level = INFO

# Console Log Settings
cdb.log.console.format = %-5p %m%n
cdb.log.console.level = INFO

# Report Settings
cdb.report.stylesheet = ${cdb.env.epoc32tree}tools\\cdb\\bcstyle.xsl

#comparisons on or off
cdb.newcompare.enable = false

Settings in the property file are defined in the form <property> = <value>. Comment lines begin with a # (hash) character. The most useful feature of the properties file is that a property can be defined in terms of another property. Take a look at the cdb.report.stylesheet property to see how this is achieved. In this case, cdb.env.epoc32tree is an internal property that is set up at runtime to equal the path to your epoc32 folder.

The settings we will modify will change:

  1. the location of the database

  2. the level of the output information generated

  3. the format of the output

You can then check if these changes have been accepted by the tool. To change the database location, modify the value of cdb.db.path property relative to the epoc root. The epocroot variable can be referenced by using the property cdb.env.epocroot.

cdb.db.path = ${cdb.env.epocroot}databases\\cdb.db

To modify the level of output, change the value of the property cdb.log.console.level to either DEBUG, INFO, WARN, ERROR, or CRITICAL. By default, the CDB provides the information to convey users what is going on. If more information is needed, set the output level to a more verbose one – such as DEBUG:

cdb.log.console.level = DEBUG

By choosing this option, more information is dumped onto the screen leading to the risk of scrolling blindness.

The format of the output can be changed to suit the display that is being used. The patterns that are permitted are explained below (this table is taken from Log4J Javadocs):

Conversion Character Effect

c

Used to output the category of the logging event. The category conversion specifier can be optionally followed by precision specifier, that is a decimal constant in brackets.

If a precision specifier is given, then only the corresponding number of right most components of the category name will be printed. By default the category name is printed in full.

For example, for the category name "a.b.c" the pattern %c{2} will output "b.c".

C

Used to output the fully qualified class name of the caller issuing the logging request. This conversion specifier can be optionally followed by precision specifier, that is a decimal constant in brackets.

If a precision specifier is given, then only the corresponding number of right most components of the class name will be printed. By default the class name is output in fully qualified form.

For example, for the class name "org.apache.xyz.SomeClass", the pattern %C{1} will output "SomeClass".

WARNING Generating the caller class information is slow. Avoid using this option unless execution speed is not an issue.

d

Used to output the date of the logging event. The date conversion specifier may be followed by a set of braces containing a date and time pattern strings SimpleDateFormat, ABSOLUTE, DATE or ISO8601. For example, %d{HH:mm:ss,SSS}, %d{dd MMM yyyy HH:mm:ss,SSS} or %d{DATE}. If no date format specifier is given then ISO8601 format is assumed.

F

Used to output the file name where the logging request was issued.

WARNING: Generating caller location information is extremely slow. Avoided using this option unless execution speed is not an issue.

l

Used to output the location information of the caller which generated the logging event. The location information depends on the JVM implementation but usually consists of the fully qualified name of the calling method followed by the callers source, the file name and the line number between parentheses. The location information can be very useful. However, it's generation is extremely slow. Avoid using this option unless execution speed is not an issue.

L

Used to output the line number from where the logging request was issued.

WARNING: Generating caller location information is extremely slow. Avoid using this option unless execution speed is not an issue.

m

Used to output the application supplied message associated with the logging event.

M

Used to output the method name where the logging request was issued.

WARNING: Generating caller location information is extremely slow. Avoid using this option unless execution speed is not an issue

n

Outputs the platform dependent line separator character(s). This conversion character offers practically the same performance as using non-portable line separator strings such as "\n", or "\r\n". Thus, it is the preferred way of specifying a line separator.

p

Used to output the priority of the logging event.

r

Used to output the time elapsed in milliseconds since the start of the application until the creation of the logging event.

t

Used to output the name of the thread that generated the logging event.

x

Used to output the NDC (nested diagnostic context) associated with the thread that generated the logging event.

X

Used to output the MDC (mapped diagnostic context) associated with the thread that generated the logging event. The X conversion character can be followed by the key for the map placed between braces, as in %X{clientNumber} where clientNumber is the key. The value in the MDC corresponding to the key will be output. If no additional sub-option is specified, then the entire contents of the MDC key value pair set is output using a format {{key1,val1},{key2,val2}}.

properties

Used to output the Properties associated with the logging event. The properties conversion word can be followed by the key for the map placed between braces, as in %properties{application} where application is the key. The value in the Properties bundle corresponding to the key will be the output. If no additional sub-option is specified, then the entire contents of the Properties key value pair set is output using a format {{key1,val1},{key2,val2}}

throwable

Used to output the Throwable trace that has been bound to the LoggingEvent, by default this will output the full trace as one would normally find by a call to Throwable.printStackTrace(). The throwable conversion word can be followed by an option in the form %throwable{short} which will only output the first line of the ThrowableInformation.

%

The sequence %% outputs a single percent sign.

Try setting the console pattern to the value below and see what happens.

cdb.log.console.pattern = %-5p [%-20.20C{1}] %-8r %4L - %m%n

This pattern will display:

To check if the property changes have been accepted by the CDB, save the properties file. And then, from command prompt in the same drive as the installed copy of CDB, type:

cdb checkconfig