
Use the following piece of code to load the configuration data from a properties file:
_propConfig = new PropertiesConfigurator( new File("logging.properties")); _propConfig.configure();
This code is mostly used in the initialization stage.
This example reads from a properties file named logging.properties, situated in the current directory, and triggers the configuration as specified in the file.
Each application stores its property files in its own properties management directory. If the logging tool cannot locate the properties file (for example, the path is wrong or it does not exist), an error message is prompted and the application continues to run without logging being switched on.
More information about the error handling concept: Administrative Issues .
Optional Periodic Reloading
An optional command exists where you can specify a periodic value (in minutes). That is, 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:
_propConfig.setPeriodicity(30);