Package org.apache.sis.util.logging
Class Initializer
Object
Initializer
Loads a logging configuration file using Java logging syntax augmented with Apache SIS extensions.
The
"java.util.logging.config.file" system property
must be set to the path of a properties file containing configuration
in the format described by LogManager.
This class applies the following filtering on the configuration file:
- Changes in
"java.util.logging.FileHandler.pattern"property value:- Replace
%pby the parent directory of the logging configuration file.
- Replace
Example
Given an application with the following directory structure:application ├─ conf/ │ └─ logging.properties └─ log/If the
logging.properties contains the following line:
java.util.logging.FileHandler.pattern = %p/log/myapp.logThen the
%p characters of that property value will be replaced by the path to the
application directory, thus allowing the application to log in the log/ sub-directory.
Other special components such as %t, %h, %g or %u are handled as usual
(i.e. as documented by FileHandler).
Usage
This class should not referenced directly by other Java code. Instead, it should be specified at JVM startup time like below:java -Djava.util.logging.config.class=org.apache.sis.util.logging.Initializer \
-Djava.util.logging.config.file=path/to/my/application/conf/logging.properties
See for example the bin/sis shell script in Apache SIS binary distribution.- Since:
- 1.3
- See Also:
Defined in the sis-utility module
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Initializer
Configures Java logging using a filtered configuration file. This constructor gets the configuration file referenced by the"java.util.logging.config.file"system property, applies the filtering described in class javadoc, then gives the filtered configuration toLogManager.readConfiguration(InputStream).This constructor should not be invoked directly. See class javadoc for usage example.
- Throws:
IOException- if an error occurred while reading the configuration file.
-