Show TOC Start of Content Area

Procedure documentation Adding, Editing and Removing Log Controllers  Locate the document in its SAP Library structure

Use

Log controller is a Java object that manages the writing of log and trace messages.

Two types of controllers are available:

      Location - describes messages that originate from source code areas, and is used to emit trace messages.

      Category - describes messages specific to distinguished problem areas, and is used to emit log messages. Typical problem areas are databases, networking, security auditing, and others.

This procedure describes how you manage the categories and the locations using the J2EE Engine Visual Administrator.

Note

The configuration steps for both categories and locations are the same. Therefore, the steps below are described for log controllers as a whole.

More information about log controllers: Identify the Output Source: Location or Category

Note

These tasks have to be done with extreme caution and only by users experienced in the SAP Logging API.

More information: SAP Logging API

Prerequisites

Start the J2EE Engine Visual Administrator by double-clicking the script file go in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/admin directory

Procedure

Adding a New Controller

...

       1.      Select the categories or locations tab if you want to create a new category or location, respectively. The new element is added as a sub-node inside the ROOT CATEGORY/ROOT LOCATION tree structure.

To add a new category/location in a particular position inside the tree structure, browse to that position and select the node under which the new category/location will be inserted. Then, continue with the next step.

       2.      Choose New.

A dialog box appears.

...

       3.      Enter the name of the new log controller.

Categories are named according to the hierarchical structure known from file systems. The different hierarchical levels in a category name must be separated by “/”, for example /System/Database (always starts with ‘/’).

Locations are labeled according to the hierarchical structure known from Java packages. The “.” character is used to demarcate the different layers in locations’ names. For example com.sap.yourPackage.Class.

Note

If you have selected a particular node, the New controller field displays the path to the selected node. Therefore, you only have to define the sub-name of your category/location at the end. Then, it will be placed as a sub-node of the selected one.

       4.      Choose OK.

The new controller is added to the tree.

       5.      Choose the Bundle Name field to assign a resource bundle name to this log controller. If a resource bundle is assigned, language-independent log messages can be written.

Note

Bundle names can be defined only if the source code of the selected log controller has a resource bundle implementation.

Editing a Controller

       1.      Select the log controller you want to edit.

       2.      You can use the Min and Max dropdown boxes as an alternative way of specifying effective severities.

Recommendation

However, it is not recommended that you use these dropdown boxes if you are not familiar with their exact usage.

For more information, see Relative Severities .

...

       6.      In the Severity dropdown box, specify the level of severity. More information about the severity levels, see Log Severities.

If you change the severity of root node or of a particular subtree and you want the change to take effect to all nodes below this root node, choose Copy severity to subtree.

       7.      Choose Relative Controllers if you want to add relative controllers to your location/category. This option is provided for advanced users only. For more information, see Relations Between Category and Location.

A dialog box appears. You can use it to change the minimum, maximum, and effective severity levels.

                            a.      Choose Add.

                            b.      In the Relative controller name dialog box use the dropdown box to select a relative controller. Choose OK.

                            c.      Use the dropdown boxes available in each Min, Max, and Effective cell to specify the required severity levels for each controller.

                            d.      Choose OK.

       8.      In the Filters pane, add filters to this controller. A filter can be added to the log controller to restrict or alter the output behavior further. For more information about filters, see Filter.

...

                            a.      Choose Add.

A dialog box appears.

                            b.      In the New Filters field, specify the name of the new filter.

                            c.      Choose OK.

The new filter is added. Additional options are provided for editing filter’s name, or removing a filter.

       9.      In the Destinations pane, add destinations to this controller.

...

                            a.      Choose Add.

A dialog box appears. You can select destinations from the list of already available destinations. A multiple option is provided for selecting more than one destination at once.

If you do not want to use any of the available destinations, choose Anonymous. In the New anonymous destination dialog box, specify the type of the new destination – it can be a ConsoleLog or a user defined type. For more information, see Log (Destination).

                            b.      When you select a destination, choose the Association dropdown box and specify how this destination to be assigned to this log controller. The associated type can be PUBLIC, LOG, PRIVATE_LOG, or LOCAL_LOG. For more information, see Log Assignment.

                            c.      Choose Select.

The new destinations are added to the Destinations pane. When you select an available destination, its association type is displayed in the Association dropdown box.

   10.      Use the log to database option to specify whether this log controller will store system critical messages in the database.

Caution

For this option to produce the desired effect, you have to set the DatabaseLogs_Enabled property of the Log Manager to “YES”. Otherwise, no logs will be stored in the database.

Note that by default this property is set to “NO”.

   11.      Choose This graphic is explained in the accompanying text Apply.

   12.      Optional: Choose the Reset to default option if you want to return to the configuration available at the time of the J2EE Engine installation. This is valid for the current controller only and has some restrictions, that is, sometimes not all the configuration is restored. Mostly, only the severity levels are reset.

Recommendation

Trace messages for standard output for STDOUT and STDERR are written in the defaultTrace.trc file to the locations System.out and System.err, respectively.

To be able to see these trace messages, you have to set the severity level of System.out to INFO, and the severity level of System.err to ERROR.

Removing a Controller

...

       1.      Select the controller you want to remove.

       2.      Choose Remove located at the bottom of the corresponding tab.

       3.      Choose This graphic is explained in the accompanying text Apply.

 

End of Content Area