Show TOC Start of Content Area

Procedure documentation Calling the Configuration Tool Locate the document in its SAP Library structure

Procedure

Use the following code snippet (usually in the initialization stage) to load the configuration data from a properties file:

This graphic is explained in the accompanying text

In your code, usually in the initialization stage:

_propConfig = new PropertiesConfigurator(

         new File("logging.properties"));

_propConfig.configure();

 

The example shown above reads from a properties file named logging.properties situated in the current directory (you can fill in an absolute file path), and triggers the configuration as specified in the file.

Each application stores its property files in its own properties management directory. If the logging toll cannot locate the properties file (because of the wrong path, it does not exist and so on), an error message is prompted and the application continues to run without logging being switched on (assuming all configuration is done through the properties file). For more information about the error handling concept, see Administrative Issues.

Optional Periodic Reloading

An optional command exists where you can specify a periodic value (in minutes) to read and load the properties file again and to scan for a new configuration automatically. This feature is useful especially in cases when a log console is available.

The API for doing this, for example reloading the properties file every 30 minutes, is:

This graphic is explained in the accompanying text

_propConfig.setPeriodicity(30);

 

End of Content Area