Class AbstractLogConfiguration
- java.lang.Object
-
- org.eclipse.rdf4j.common.app.logging.base.AbstractLogConfiguration
-
- All Implemented Interfaces:
Configuration,LogConfiguration
- Direct Known Subclasses:
LogbackConfiguration,LogConfigurationBase
public abstract class AbstractLogConfiguration extends java.lang.Object implements LogConfiguration
Base implementation of LogConfiguration.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FilebaseDirprivate java.io.FileconfDirprivate AppConfigurationconfigprivate booleandebugLoggingEnabledprivate static java.lang.StringLOGGING_CONFIG_FILEprivate java.io.FileloggingDirprivate java.util.Set<java.lang.String>packagesprivate static java.lang.StringPACKAGES_JUL_KEYprivate static java.lang.StringPACKAGES_SLF4J_KEY-
Fields inherited from interface org.eclipse.rdf4j.common.app.config.Configuration
DEFAULT_RESOURCES_LOCATION, DIR, RESOURCES_LOCATION
-
Fields inherited from interface org.eclipse.rdf4j.common.app.logging.LogConfiguration
ADMIN_EVENT_LOG_FILE, ADMIN_EVENT_LOGGER_NAME, LOG_FILE, LOGGING_DIR, USER_EVENT_LOG_FILE, USER_EVENT_LOGGER_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractLogConfiguration()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AppConfigurationgetAppConfiguration()Get application configurationjava.io.FilegetBaseDir()The base location on the file system for logging configuration and datajava.io.FilegetConfDir()The location on the file system where logging configuration is stored.java.io.FilegetLoggingDir()The location on the file system where logging data is stored.protected java.util.Set<java.lang.String>getPackages()Get packages as a setprivate voidinitBase()Initialize logging, setting log levels and handlers.booleanisDebugLoggingEnabled()Is debug logging enabled?voidsetAppConfiguration(AppConfiguration config)Set application configurationvoidsetBaseDir(java.io.File baseDir)Set the base location on the file system for logging configuration and datavoidsetDebugLoggingEnabled(boolean debugLoggingEnabled)Enable or disable debug logging.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.common.app.config.Configuration
destroy, init, load, save
-
Methods inherited from interface org.eclipse.rdf4j.common.app.logging.LogConfiguration
getDefaultLogReader, getLogReader
-
-
-
-
Field Detail
-
LOGGING_CONFIG_FILE
private static final java.lang.String LOGGING_CONFIG_FILE
- See Also:
- Constant Field Values
-
PACKAGES_SLF4J_KEY
private static final java.lang.String PACKAGES_SLF4J_KEY
- See Also:
- Constant Field Values
-
PACKAGES_JUL_KEY
private static final java.lang.String PACKAGES_JUL_KEY
- See Also:
- Constant Field Values
-
baseDir
private java.io.File baseDir
-
confDir
private java.io.File confDir
-
loggingDir
private java.io.File loggingDir
-
debugLoggingEnabled
private boolean debugLoggingEnabled
-
packages
private final java.util.Set<java.lang.String> packages
-
config
private AppConfiguration config
-
-
Method Detail
-
setBaseDir
public void setBaseDir(java.io.File baseDir) throws java.io.IOExceptionDescription copied from interface:LogConfigurationSet the base location on the file system for logging configuration and data- Specified by:
setBaseDirin interfaceLogConfiguration- Parameters:
baseDir- the base location on the file system for logging configuration and data- Throws:
java.io.IOException
-
getBaseDir
public java.io.File getBaseDir()
Description copied from interface:LogConfigurationThe base location on the file system for logging configuration and data- Specified by:
getBaseDirin interfaceLogConfiguration- Returns:
- the base location on the file system for logging configuration and data
-
getConfDir
public java.io.File getConfDir()
Description copied from interface:LogConfigurationThe location on the file system where logging configuration is stored.- Specified by:
getConfDirin interfaceLogConfiguration- Returns:
- the location on the file system where logging configuration is stored
-
getLoggingDir
public java.io.File getLoggingDir()
Description copied from interface:LogConfigurationThe location on the file system where logging data is stored.- Specified by:
getLoggingDirin interfaceLogConfiguration- Returns:
- the location on the file system where logging data is stored
-
initBase
private void initBase() throws java.io.IOExceptionInitialize logging, setting log levels and handlers.- Throws:
java.io.IOException
-
isDebugLoggingEnabled
public boolean isDebugLoggingEnabled()
Description copied from interface:LogConfigurationIs debug logging enabled?- Specified by:
isDebugLoggingEnabledin interfaceLogConfiguration- Returns:
- true if debug logging is enabled, false otherwise
-
setDebugLoggingEnabled
public void setDebugLoggingEnabled(boolean debugLoggingEnabled)
Description copied from interface:LogConfigurationEnable or disable debug logging.- Specified by:
setDebugLoggingEnabledin interfaceLogConfiguration- Parameters:
debugLoggingEnabled- set to true if debug logging should be enabled, set to false otherwise
-
getPackages
protected java.util.Set<java.lang.String> getPackages()
Get packages as a set- Returns:
- packages as set of string
-
getAppConfiguration
public AppConfiguration getAppConfiguration()
Description copied from interface:LogConfigurationGet application configuration- Specified by:
getAppConfigurationin interfaceLogConfiguration- Returns:
- application configuration
-
setAppConfiguration
public void setAppConfiguration(AppConfiguration config)
Description copied from interface:LogConfigurationSet application configuration- Specified by:
setAppConfigurationin interfaceLogConfiguration- Parameters:
config- application configuration
-
-