Show TOC Start of Content Area

Background documentation Summary Highlights  Locate the document in its SAP Library structure

The syntax rule described in the Javadoc API helps you to validate your syntax. Therefore, this section explains what attributes/values can be paired/assigned with/to what objects, what is required and what is optional, and so on.

This graphic is explained in the accompanying text

The list is not complete, therefore, we recommend that you refer to the Javadoc API for the complete semantics.

Summary of Configurable Attributes of Some Classes

Class

Possible Attribute

Reference to API

Multiple entries

Required

LogController

 

General for both Location, Category

 

 

 

severity

<logController>.setEffectiveSeverity(int)

 

 

 

effSeverity

(same as ‘severity’)

 

 

 

minSeverity

<logController>.setMinimumSeverity(int)

 

 

 

maxSeverity

<logController>.setMaximumSeverity(int)

 

 

 

logs

<logController>.addLog(Log)

X

 

 

localLogs

<logController>.addLocalLog(Log)

X

 

 

privateLogs

<logController>.addPrivateLog(Log)

X

 

 

filters

<logController>.addFilter(Filter)

X

 

 

bundleName

<logController>.setResourceBundleName(String)

 

 

Log

 

General for all Log subclasses

 

 

 

 

severity <log>.setEffectiveSeverity(int)

 

 

 

effSeverity

(same as ‘severity’)

 

 

 

encoding

<log>.setEncoding(String)

 

 

 

formatter

<log>.setFormatter(Formatter)

 

 

 

filters

<log>.addFilter(Filter)

X

 

FileLog

pattern

new FileLog(String)                 //Filename

X

 

 

 

limit      new FileLog(String, int, int)

 

 

 

cnt

(same as ‘limit’)

 

 

Formatter

pattern

<formatter>.setPattern(String)  //message format

 

 

 

      In case of an attribute that takes a class, as listed above, such as Log or Formatter, you have to either use the classname directly or the notation of a variable. For more information, see Syntax and Semantics of the Properties File.

      In case of a primitive data type, you can easily assign an integer or string as an attribute value (except Severity, see the table below).

      In case of a Filter interface, assign the fully qualified classname of the user-defined class (make sure the class is already included in the classpath, and use an appropriate class loader). This also applies to user-defined classes for Log and Formatter: use a full classname if you are not using the standard classes provided by the SAP Logging API.

Attribute

Type

Possible Value

Description

severity, effSeverity, minSeverity, maxSeverity

Integer

NONE

But constants defined in class Severity for your convenience.

 

 

FATAL

Refer to Javadoc of class Severity.

 

 

ERROR

All are case-sensitive.

 

 

WARNING

 

 

 

INFO

 

 

 

PATH

 

 

 

DEBUG

 

 

 

ALL

 

logs    (classname)

Log

FileLog

Again, case-sensitive.

 

 

ConsoleLog

 

logs    (variable)

 

log[<id>]

<id> can be any logical, meaningful name

formatter   (classname)

Formatter

TraceFormatter

 

 

 

ListFormatter

 

 

 

XMLFormatter

 

formatter    (variable)

 

formatter[<id>]

<id> can be any logical, meaningful name

Filters         (classname)

Filter (interface)

com.sapmarkets.um.logging.Filter

Actual implementation defined by users. The arbitrary value shown on the left column indicates a class named ‘Filter’ is defined by user under the package ‘com.sapmarkets.um.logging’.

 

This graphic is explained in the accompanying text

If you want to use the concept of relative severities, you can do this in the properties file using square brackets.

For more information see the table below.

Class

Attricute of Relative severity

Reference to API

LogController

 

General for both Location, Category

 

severity[<full name of relative location or category>]

<logController>.setEffectiveSeverity(Location, int)<logController>.setEffectiveSeverity(Category, int)

 

effSeverity[<full name of relative location or category>]

(same as ‘severity’)

 

minSeverity[<full name of relative location or category>]

<logController>.setMinimumSeverity(Location, int)<logController>.setMinimumSeverity(Category, int)

 

maxSeverity[<full name of relative location or category>]

<logController>.setMaximumSeverity(Location, int)<logController>.setMaximumSeverity(Category, int)

 

Example

Category /System/Infrastructure/DB establishes a relative severity with location com.sap.fooPackage.ClassX.

Using the coding API:

Location _loc = Location.getLocation("com.sap.fooPackage.ClassX");

Category _cat = Category.getCategory("/ System / Infrastructure / Database");

_cat.setEffectiveSeverity(_loc, Severity.WARNING);

Using the properties file:

System/Infrastructure/DB.severity[com.sap.fooPackage.ClassX]   = WARNING

 

End of Content Area