public class PropertiesConfigurationLoader extends 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 and Description |
---|
PropertiesConfigurationLoader() |
Modifier and Type | Method and Description |
---|---|
protected String[] |
getConfigurationFiles()
Retrieve an array of configuration files.
|
Properties |
load()
Loads all configuration properties.
|
protected void |
load(Properties properties,
InputStream stream)
Puts all properties from a stream to an existing properties object.
|
public Properties load()
load
in interface ConfigurationLoader
protected void load(Properties properties, InputStream stream) throws IOException
properties
- Read properties will be put to this properties objectstream
- Input stream with a properties fileIOException
- Failed reading properties from input streamprotected String[] getConfigurationFiles()
Copyright © 2024. All rights reserved.