Entering content frame

Object documentation log-configuration.dtd Locate the document in its SAP Library structure

Use

A document type definition (DTD) used for configuring logs for server components and applications. The log-configuration.xml is consequently parsed to follow the grammar of log-configuration.dtd. This DTD is a rule for defining specific settings for logging such as log controllers, log destinations, and so on.

Structure

The log-configuration.dtd defines the following elements:

This graphic is explained in the accompanying text
 


The usage of each element is explained in detail as follows:

 

<!--

This is the root element for log configuration.

-->

<!ELEMENT log-configuration (log-formatters?, log-destinations?, log-controllers?)>

 

<!--

Contains a list of log formatters.

-->

<!ELEMENT log-formatters (log-formatter*)>

 

<!--

Contains a list of log destinations.

-->

<!ELEMENT log-destinations (log-destination*)>

 

<!--

Contains a list of log controllers.

-->

<!ELEMENT log-controllers (log-controller*)>

 

<!--

Contains a list of log filters.

-->

<!ELEMENT log-filters (log-filter*)>

 

<!--

Contains a list of associated destinations. You can have a destination-ref or an anonymous-destination. These two types are displayed further in this document.

-->

<!ELEMENT associated-destinations ((destination-ref|anonymous-destination)*)>

 

<!--

Describes a formatter used for formatting log records.

-->

<!ELEMENT log-formatter EMPTY>

 

<!--

A mandatory attribute that specifies the name of the new formatter.
Example:

<log-formatters>
    <log-formatter name='myFormatter' type='mypackage.FormatterImpl' pattern='somePattern'/>
   <log-formatter name='anotherFormatter' type="mypackage.AnotherFormatterImpl" pattern='anotherPattern'/>
  </log-formatters>
-->

<!ATTLIST log-formatter name CDATA #REQUIRED>

 

<!--

Defines the type of the formatter. The following default formatter types are available: ListFormetter, TraceFormatter, XMLFormatter. You can also use your own formatter type.

-->

<!ATTLIST log-formatter type NMTOKEN #REQUIRED>

 

<!--

Configures the formatter with a custom formatting pattern. The pattern allows you to specify the message data fields, with place holders of the form %[[-]<width>[-]]<type>, interspersed with arbitrary text that you want to have included in formatted messages (currently available only for formatters of type TraceFormatter).

-->

<!ATTLIST log-formatter pattern CDATA #IMPLIED>

 

<!--

Describes a log destination (which is an abstraction of a file, console output, etc.). To a destination you can associate additional or already available formatters and filters.

-->

<!ELEMENT log-destination ((formatter-ref|anonymous-formatter)?, log-filters?)>

 

<!--

Set the name of the destination.
Example:

<log-destinations>

   <log-destination name='myDestination0' type='FileLog' pattern='c:\dest0.log' effective-severity='ERROR'  encoding='Cp1047' count="5" limit='800000'>
     <formatter-ref name='myFormatter'/>
     <log-filters>
      <log-filter type='myPackage.SomeFilter'/>
     </log-filters>
   </log-destination>

    <log-destination name='myDestination1' type='ConsoleLog'>
      <anonymous-formatter type='TraceFormatter'/>
      <log-filters>
        <log-filter type='mypackage.MyLogFilter'/>
      </log-filters>
    </log-destination>
  </log-destinations>

-->

<!ATTLIST log-destination name ID #REQUIRED>

 

<!--

Sets the destination type. You can either specify your own type, or set a default one: FileLog or ConsoleLog. If you select a ConsoleLog you do not need to specify Pattern, Limit, and Count.

-->

<!ATTLIST log-destination type NMTOKEN #REQUIRED>

 

<!--

Specifies the path to the file where the logs will be written (applicable only for log destinations of type FileLog).

-->

<!ATTLIST log-destination pattern CDATA #IMPLIED>

 

<!--

Sets the effective severity of this log.

-->

<!ATTLIST log-destination effective-severity %severities; #IMPLIED>

 

<!--

Sets the named character encoding to be used for this log. If no character encoding is set the default character encoding is used.

-->

<!ATTLIST log-destination encoding CDATA #IMPLIED>

 

<!--

Specifies the number of log files for this destination. If it is not specified, only one file is used. If a number is specified, when the size of the first file reaches the limit specified in the Limit tag the system starts to write in the second one; this procedure is executed until all the specified files are full, then the system starts to write again in the first file, that is, overwrites the first one.

-->

<!ATTLIST log-destination count CDATA #IMPLIED>

 

<!--

Specifies the size of the file where the logs will be generated.

-->

<!ATTLIST log-destination limit CDATA #IMPLIED>

 

<!--

Associates the log destination that is described in the parent tag log-destination with a formatter described in a log-formatter tag. Only one formatter can be associated with a destination.

-->

<!ELEMENT formatter-ref EMPTY>

 

<!--

The name of the formatter

-->

<!ATTLIST formatter-ref name CDATA #REQUIRED>

 

<!--

Associates the log destination that is described in the parent tag log-destination with an anonymous formatter (that is a formatter that is not explicitly described with a log-formatter tag). One cannot specify a pattern for an anonymous formatter

-->

<!ELEMENT anonymous-formatter EMPTY>

 

<!-–

Specifies the type of the anonymous formatter.

-->

<!ATTLIST anonymous-formatter type NMTOKEN #REQUIRED>

 

<!--

Describes a log controller. The log controller is an abstraction of a logger that can be used either for tracing (in this case it is called Location and “.” symbol is used as a separator to denote the hierarchical structure) of for logging (then it is called Category and “/” symbol is used as a separator).

-->

<!ELEMENT log-controller (minimum-relative-severity*, maximum-relative-severity*, relative-severity*, associated-destinations?, log-filters?)>

 

<!--

Describes the name of the log controller. Two types of log controller names are available – names for categories and names for locations.

Categories are named according to the hierarchical structure known from file systems. You can group together all the categories of log messages concerned with one particular issue under one category. The category name must be separated by “/”.

Locations are named according to the hierarchical structure known from Java packages. The category name must be separated by “.”.

-->

<!ATTLIST log-controller name CDATA #REQUIRED>

 

<!--

Sets effective severity to this log controller.

-->

<!ATTLIST log-controller effective-severity %severities; #IMPLIED>

 

<!--

Sets minimum severity to this log controller.

-->

<!ATTLIST log-controller minimum-severity %severities; #IMPLIED>

 

<!--

Sets maximum severity to this log controller

-->

<!ATTLIST log-controller maximum-severity %severities; #IMPLIED>

 

<!--

Assigns a resource bundle name to this log controller. If a resource bundle is assigned, language-independent log messages can be written.

-->

<!ATTLIST log-controller bundle-name CDATA #IMPLIED>

 

<!--

An optional attribute that specifies whether this log controller will store system critical messages in the database. The default value is "true".

-->

<!ATTLIST log-controller db-log %boolean; #IMPLIED>

 

<!--

Sets the minimum severity of this log controller. If its current maximum severity is lower than the argument, the former is set to the argument. If it is a root controller, this method has the same effect as a call to the effective-severity .

-->

<!ELEMENT minimum-relative-severity EMPTY>

 

<!--

The name of the relative controller.

-->

<!ATTLIST minimum-relative-severity relative-controller CDATA #REQUIRED>

 

<!--

The value of the minimum relative severity.

-->

<!ATTLIST minimum-relative-severity value %severities; #REQUIRED>

 

<!--

Sets the maximum severity of this log controller. If its current minimum severity is higher than the argument, the former is set to the argument. If it is a root controller, the method has the same effect as a call to the effective-severity .

-->

<!ELEMENT maximum-relative-severity EMPTY>

 

<!--

The name of the relative controller.

-->

<!ATTLIST maximum-relative-severity relative-controller CDATA #REQUIRED>

 

<!--

The value of the maximum relative severity.

-->

<!ATTLIST maximum-relative-severity value %severities; #REQUIRED>

 

<!--

Sets relative severity to the described log controller. When a relative severity is set, the effective severity is calculated as the minimum severity of direct severity and severity related to its relative.

-->

<!ELEMENT relative-severity EMPTY>

 

<!--

The name of the relative controller.

-->

<!ATTLIST relative-severity relative-controller CDATA #REQUIRED>

 

<!--

The value of the relative severity.

-->

<!ATTLIST relative-severity value %severities; #REQUIRED>

 

<!--

Describes a filter that, besides the effective severity, controls output via the log controller or log destination. The results of all filters for a given message are logically anded to determine whether a message is to be written to the associated log objects.

-->

<!ELEMENT log-filter EMPTY>

 

<!--

The type (that is, the full-packaged class name) of the filter.

-->

<!ATTLIST log-filter type NMTOKEN #REQUIRED>

 

<!--

Associates the log controller that is described in the parent tag log-controller with a formatter described in a log-destination tag. Many destinations can be associated with a log controller.

-->

<!ELEMENT destination-ref EMPTY>

 

<!--

The name of the associated destination.

-->

<!ATTLIST destination-ref name IDREF #REQUIRED>

 

<!--

Specifies the type of the association. It can be one of these : PRIVATE_LOG, LOCAL_LOG or LOG

-->

<!ATTLIST destination-ref association-type %association-types; #REQUIRED>

 

<!--

Associates the log controller that is described in the parent tag log-controller with an anonymous destination (that is a destination that is not explicitly described with a log-destination tag). One cannot specify additional attributes(except type) for an anonymous destination.

-->

<!ELEMENT anonymous-destination EMPTY>

 

<!--

Sets the destination type. You can either specify your own type, or set a default one: FileLog or ConsoleLog. If you select a ConsoleLog you do not need to specify Pattern, Limit, and Count.

-->

<!ATTLIST anonymous-destination type NMTOKEN #REQUIRED>

 

<!--

Specifies the type of the association. It can be one of these: PRIVATE_LOG, LOCAL_LOG or LOG

-->

<!ATTLIST anonymous-destination association-type %association-types; #REQUIRED>

 

 

Leaving content frame