ConfigurationLoader
public class PropertiesConfigurationLoader extends java.lang.Object implements ConfigurationLoader
By default, the configuration will be loaded from tinylog.properties
in the default package. Another
configuration file can be loaded by setting the system property tinylog.configuration
. The configuration file
can be a resource in the classpath, a file from file system or an URL
Alternately configuration properties can be set via system properties. These properties must be prefixed by
"tinylog.
". For example: "level = debug
" becomes "tinylog.level=debug
". If a configuration
property exists as system property and in configuration file, the system property will win.
Constructor | Description |
---|---|
PropertiesConfigurationLoader() |
Modifier and Type | Method | Description |
---|---|---|
protected java.lang.String[] |
getConfigurationFiles() |
Retrieve an array of configuration files.
|
java.util.Properties |
load() |
Loads all configuration properties.
|
protected void |
load(java.util.Properties properties,
java.io.InputStream stream) |
Puts all properties from a stream to an existing properties object.
|
public java.util.Properties load()
load
in interface ConfigurationLoader
protected void load(java.util.Properties properties, java.io.InputStream stream) throws java.io.IOException
properties
- Read properties will be put to this properties objectstream
- Input stream with a properties filejava.io.IOException
- Failed reading properties from input streamprotected java.lang.String[] getConfigurationFiles()
Copyright © 2022. All rights reserved.