Entering content frame

Background documentation Logger Configuration Locate the document in its SAP Library structure

Each logger that is accessed by the Portal Logging API is defined in the following files:

·        Logger.xml     in the WEB-INF\portal\system\xml directory. It contains internal PRT loggers such as the default logger.

·        Logger.xml     in the PORTAL-INF/logger folder of the PAR file. Each portal application can define its own logger by packaging a logger configuration file in its PAR as described below:

Example

<Portal Archive>

  |

  +-- META-INF

  +-- MANIFEST.MF

  +-- …

  +-- PORTAL-INF

  |   |

  |   +-- portalapp.xml

  |   |   +-- logger

  |   |       +-- logger.xml

The logger configuration file gives a list of PRT loggers. Following an implementation, each logger in this list follows a model proposing two views on the loggers.

·        Application developer view

A logger is defined by its name, a Java interface, a string formatting pattern, the default activation flag and a logging level. Once a logger has been defined it is accessed through the Portal Runtime API:

¡        getLogger(String) on the Portal Component Request.

¡        getLogger(String) on the Service Context.

By default, these methods return an ILogger object. However, the PRT offers a way to define and return another interface.

·        Administrator view

A logger is associated to one or many logging class defining the output channels.

This separation allows you to easily manage the log files without disturbing the application behavior.

The following example shows a part of the logger.xml used to define the default logger of the PRT.

Example

<Logger

          name                 = "default_logger"

          loggerInterface      = "com.sapportals.portal.prt.logger.ILogger"

          isActive             = "true"

          pattern              = "%d # %20t %15s %m #">

          <LoggerClass

                 className      = "com.sapportals.portal.prt.logger.SimpleFileLogger"

                 level          = "WARNING">

                 <param

                     filename   = "logs/workplace.log"

                     append     = "false"

                     limit      = "800000">

                 </param>

           </LoggerClass>

           <LoggerClass

                 className      = "com.sapportals.portal.prt.logger.ConsoleLogger"

                 level          = "SEVERE"

                 >

           </LoggerClass>

</logger>

 

 

 

 

Leaving content frame