ch.qos.logback.core.joran
Class GenericConfigurator

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.joran.GenericConfigurator
All Implemented Interfaces:
ContextAware
Direct Known Subclasses:
JoranConfiguratorBase, SiftingJoranConfiguratorBase, SimpleConfigurator

public abstract class GenericConfigurator
extends ContextAwareBase


Field Summary
protected  Interpreter interpreter
           
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
GenericConfigurator()
           
 
Method Summary
protected  void addDefaultNestedComponentRegistryRules(DefaultNestedComponentRegistry registry)
           
protected abstract  void addImplicitRules(Interpreter interpreter)
           
protected abstract  void addInstanceRules(RuleStore rs)
           
protected  void buildInterpreter()
          Builds a generic configuration-XML interpreter
 void doConfigure(File file)
          Configures logback with the configuration XML read from a given file
 void doConfigure(InputStream inputStream)
          Configures logback with the configuraiton XML read from an input stream, and then closes the stream
 void doConfigure(List<SaxEvent> eventList)
          Configures logback with SAX events of configuration XML
 void doConfigure(String filename)
          Configures logback with the configuration XML read from a file, located at the given path on the host filesystem
 void doConfigure(URL url)
          Configures logback with the configuration XML read from a file, located at the given URL
static void informContextOfURLUsedForConfiguration(Context context, URL url)
          Adds the URL of the used configuration file to the watch list, which is periodically scanned for changes when the "scan" flag is set in logback.xml (<configuration scan="true" ...>).
protected  Pattern initialPattern()
          Gets the initial pattern
 List<SaxEvent> recallSafeConfiguration()
          Recall the event list previously registered as a safe point.
 void registerSafeConfiguration()
          Register the current event list in the interpreter as a safe configuration point.
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interpreter

protected Interpreter interpreter
Constructor Detail

GenericConfigurator

public GenericConfigurator()
Method Detail

doConfigure

public final void doConfigure(URL url)
                       throws JoranException
Configures logback with the configuration XML read from a file, located at the given URL

Parameters:
url - URL to the file, containing the configuration XML
Throws:
JoranException

doConfigure

public final void doConfigure(String filename)
                       throws JoranException
Configures logback with the configuration XML read from a file, located at the given path on the host filesystem

Parameters:
filename - path to the file, containing the configuration XML
Throws:
JoranException

doConfigure

public final void doConfigure(File file)
                       throws JoranException
Configures logback with the configuration XML read from a given file

Parameters:
file - the file, containing the configuration XML
Throws:
JoranException

informContextOfURLUsedForConfiguration

public static void informContextOfURLUsedForConfiguration(Context context,
                                                          URL url)
Adds the URL of the used configuration file to the watch list, which is periodically scanned for changes when the "scan" flag is set in logback.xml (<configuration scan="true" ...>).

Parameters:
context - the logger context to modify
url - the URL to add

doConfigure

public final void doConfigure(InputStream inputStream)
                       throws JoranException
Configures logback with the configuraiton XML read from an input stream, and then closes the stream

Parameters:
inputStream - stream to contents of configuration XML
Throws:
JoranException

addInstanceRules

protected abstract void addInstanceRules(RuleStore rs)

addImplicitRules

protected abstract void addImplicitRules(Interpreter interpreter)

addDefaultNestedComponentRegistryRules

protected void addDefaultNestedComponentRegistryRules(DefaultNestedComponentRegistry registry)

initialPattern

protected Pattern initialPattern()
Gets the initial pattern

Returns:
a newly created Pattern

buildInterpreter

protected void buildInterpreter()
Builds a generic configuration-XML interpreter


doConfigure

public void doConfigure(List<SaxEvent> eventList)
                 throws JoranException
Configures logback with SAX events of configuration XML

Parameters:
eventList - list of SAX events
Throws:
JoranException

registerSafeConfiguration

public void registerSafeConfiguration()
Register the current event list in the interpreter as a safe configuration point.

Since:
0.9.30

recallSafeConfiguration

public List<SaxEvent> recallSafeConfiguration()
Recall the event list previously registered as a safe point.



Copyright © 2005-2013 QOS.ch. All Rights Reserved.