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 ApplicationContextSpring application context.private ResourceLogging configuration resource.private ResourceURL to the fallback logback configuration found in the IdP jar.private ch.qos.logback.classic.LoggerContextLogback logger context.private ch.qos.logback.core.status.StatusManagerLogger used to log messages without relying on the logging system to be full initialized. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voiddoReload()Gets the logging configuration..protected voidAdd theIdPPropertiesApplicationContextInitializer.IDP_HOME_PROPERTYproperty from the Spring application context to the logger context.protected voidReads and loads in a new logging configuration.protected voidloadLoggingConfiguration(InputStream loggingConfig) Loads a logging configuration in to the active logger context.voidsetApplicationContext(ApplicationContext context) voidsetLoggingConfiguration(Resource configuration) Sets the logging configuration.protected booleanMethods inherited from class net.shibboleth.utilities.java.support.service.AbstractReloadableService
doDestroy, getLastReloadAttemptInstant, getLastSuccessfulReloadInstant, getLogPrefix, getReloadCheckDelay, getReloadFailureCause, getReloadTaskTimer, isFailFast, reload, setFailFast, setReloadCheckDelay, setReloadTaskTimerMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getIdMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitializedMethods 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:
setLoggingConfigurationin interfaceLoggingService- Parameters:
configuration- logging configuration
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware
-
getServiceableComponent
. This service does not support a ServiceableComponent, so return null.- Specified by:
getServiceableComponentin interfaceReloadableService<Object>
-
doInitialize
- Overrides:
doInitializein classAbstractReloadableService<Object>- Throws:
ComponentInitializationException
-
shouldReload
protected boolean shouldReload()- Specified by:
shouldReloadin classAbstractReloadableService<Object>
-
doReload
protected void doReload()- Overrides:
doReloadin 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_PROPERTYproperty from the Spring application context to the logger context.
-