Package net.shibboleth.idp.log
Class LogbackLoggingService
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
net.shibboleth.utilities.java.support.service.AbstractReloadableService<Object>
net.shibboleth.idp.log.LogbackLoggingService
- All Implemented Interfaces:
LoggingService
,Component
,DestructableComponent
,IdentifiableComponent
,IdentifiedComponent
,InitializableComponent
,UnmodifiableComponent
,ReloadableService<Object>
,Aware
,ApplicationContextAware
public class LogbackLoggingService
extends AbstractReloadableService<Object>
implements LoggingService, ApplicationContextAware
Simple
LoggingService
that watches for logback configuration file changes
and reloads the file when a change occurs.-
Nested Class Summary
Nested classes/interfaces inherited from class net.shibboleth.utilities.java.support.service.AbstractReloadableService
AbstractReloadableService.ServiceReloadTask
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ApplicationContext
Spring application context.private Resource
Logging configuration resource.private Resource
URL to the fallback logback configuration found in the IdP jar.private ch.qos.logback.classic.LoggerContext
Logback logger context.private ch.qos.logback.core.status.StatusManager
Logger used to log messages without relying on the logging system to be full initialized. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
doReload()
Gets the logging configuration..protected void
Add theIdPPropertiesApplicationContextInitializer.IDP_HOME_PROPERTY
property from the Spring application context to the logger context.protected void
Reads and loads in a new logging configuration.protected void
loadLoggingConfiguration
(InputStream loggingConfig) Loads a logging configuration in to the active logger context.protected void
Log the IdP version and Java version and vendor at INFO level.void
setApplicationContext
(ApplicationContext context) void
setLoggingConfiguration
(Resource configuration) Sets the logging configuration.protected boolean
Methods inherited from class net.shibboleth.utilities.java.support.service.AbstractReloadableService
doDestroy, getLastReloadAttemptInstant, getLastSuccessfulReloadInstant, getLogPrefix, getReloadCheckDelay, getReloadFailureCause, getReloadTaskTimer, isFailFast, reload, setFailFast, setReloadCheckDelay, setReloadTaskTimer
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
Methods inherited from interface net.shibboleth.utilities.java.support.service.ReloadableService
getLastReloadAttemptInstant, getLastSuccessfulReloadInstant, getReloadFailureCause, reload
-
Field Details
-
loggerContext
private ch.qos.logback.classic.LoggerContext loggerContextLogback logger context. -
statusManager
private ch.qos.logback.core.status.StatusManager statusManagerLogger used to log messages without relying on the logging system to be full initialized. -
fallbackConfiguration
URL to the fallback logback configuration found in the IdP jar. -
configurationResource
Logging configuration resource. -
applicationContext
Spring application context.
-
-
Constructor Details
-
LogbackLoggingService
public LogbackLoggingService()
-
-
Method Details
-
getLoggingConfiguration
Gets the logging configuration.- Returns:
- logging configuration
-
setLoggingConfiguration
Sets the logging configuration.- Specified by:
setLoggingConfiguration
in interfaceLoggingService
- Parameters:
configuration
- logging configuration
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
-
getServiceableComponent
. This service does not support a ServiceableComponent, so return null.- Specified by:
getServiceableComponent
in interfaceReloadableService<Object>
-
doInitialize
- Overrides:
doInitialize
in classAbstractReloadableService<Object>
- Throws:
ComponentInitializationException
-
shouldReload
protected boolean shouldReload()- Specified by:
shouldReload
in classAbstractReloadableService<Object>
-
doReload
protected void doReload()- Overrides:
doReload
in classAbstractReloadableService<Object>
-
loadLoggingConfiguration
protected void loadLoggingConfiguration()Reads and loads in a new logging configuration.- Throws:
ServiceException
- thrown if there is a problem loading the logging configuration
-
loadLoggingConfiguration
Loads a logging configuration in to the active logger context. Error messages are printed out to the status manager.- Parameters:
loggingConfig
- logging configuration file- Throws:
ServiceException
- thrown is there is a problem loading the logging configuration
-
loadIdPHomeProperty
protected void loadIdPHomeProperty()Add theIdPPropertiesApplicationContextInitializer.IDP_HOME_PROPERTY
property from the Spring application context to the logger context. -
logImplementationDetails
protected void logImplementationDetails()Log the IdP version and Java version and vendor at INFO level. Log system properties defined byStandardSystemProperty
at DEBUG level.
-