Adding, Editing, and Removing Log
Controllers
The log controllers control the output to logs. Log controllers are the objects you call to write messages. To this end, log controllers provide you with methods for associating logs with them and for controlling the actual writing of messages. Two types of controllers are available:
● Location – describes messages that originate from delimited source code areas, and is above all used to emit trace messages.
● Category – describes messages specific to distinguished problem areas, and is above all used to emit log messages. Typical problem areas are databases, networking, security auditing, and others.
For more
information about log controllers, see
Identify the Output
Source: Location or Category in the SAP Logging API tutorial.
This procedure describes how you manage the categories and the locations using the J2EE Engine Visual Administrator.

The configuration steps for both categories and controllers are the same, therefore the steps below are described for log controllers as a whole.
Adding, editing, and removing log controllers has to be done with extreme caution and only by experienced users.
...
1. Select the Categories tab if you want to create a new category, or the Locations tab if you want a new location. The new element is added as a new sub-node of the ROOT CATEGORY / ROOT LOCATION tree structure. If you want to add a new category / location in a particular position inside an already available tree structure, browse to that position, select the node under which the new category/location will be added, and then continue with the next step.
2. Choose New. The New controller dialog box appears.
...
a. In the New controller field, enter the name of the new controller.
Categories are named according to the hierarchical structure known from file systems. You can group together all types of log messages concerning one particular issue under one category. 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.

If you have selected a particular node, the New controller field will display the path to the selected node. You only have to define the sub-name of your category/location at the end and it will be placed as a sub-node of the selected one.
If you have selected a node with an empty circle icon and you want this node to become a category/location, choose OK when the New controller field appears without entering anything in it.
b. Choose OK.
The new controller is added to the tree.
3. 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.

Bundle names can be defined only if the source code of the selected log controller has a resource bundle implementation.
4.
You can use the
Min and Max dropdown boxes as an alternative way of specifying
effective severities. 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 in the SAP Logging API tutorial.
...
5. In the Severity dropdown box, specify the severity log level. The severity settings of a log controller specify what types of messages can be written via this log controller. The less restrictive value you use, the more types of messages will be written. That is, you will have more information (about less critical events) at the expense of more system resources. For more information about the severity levels, see Log Severities.
6. If you are changing the severity of root node of the whole tree or of a particular subtree and you want the change to take effect to all nodes below this root node, select the Copy severity to subtree option.
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 in the SAP Logging API tutorial.
The Relative Controllers dialog box appears. You can use this dialog box 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
in the SAP Logging API
tutorial):
...
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.
The Add Destination 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)
in the SAP Logging API tutorial.
b.
When you select a
destination, choose the Association dropdown box
and specify how this destination will be assigned to this log controller. The
associated type can be PUBLIC, LOG, PRIVATE_LOG, or LOCAL_LOG. For more information, see
Log Assignment in
the SAP Logging API tutorial.
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.
Additional options are provided for editing the destination (this will lead you to the Destinations), for removing a destination, or for describing it (this opens a pop-up where the destination parameters are listed).
10. Use the log to database option to specify whether this log controller will store system critical messages in the database.

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
Apply.
...
1. Select the controller you want to edit.
2. Modify the desired parameters.
3.
Choose
Apply.

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 will be restored, some references to destinations that were already removed will not be restored, for example, and so on. Most of the times, only the severity levels will be reset.

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.
...
1. Select the controller you want to remove.
2. Choose Remove located at the bottom of the corresponding tab.
3.
Choose
Apply.
