Skip to content
Commit b8af298c authored by Ceki Gulcu's avatar Ceki Gulcu
Browse files

- Initial commit of HoardingAppender

HoardingAppender contains other appenders which it can build
dynamically depending on MDC values. The built appender is specified
as part of a configuration file. Here is an example.

<configuration debug="true">
  <appender name="HOARD"  class="ch.qos.logback.classic.hoard.HoardingAppender">
    <mdcKey>userid</mdcKey>
    <hoard>
      <!-- you can put any appender here -->
      <appender name="file-${userid}" class="ch.qos.logback.core.FileAppender">
        <File>${userid}.log</File>
        <Append>true</Append>
        <layout class="ch.qos.logback.classic.PatternLayout">
          <Pattern>%d [%thread] %level %logger{35} - %msg%n</Pattern>
        </layout>
      </appender>
    </hoard>
  </appender>
  <root level="DEBUG">
    <appender-ref ref="HOARD" />
  </root>
</configuration>

A new file appender will be built each according to the MDC value
associated with the key "userid" when a logging event occurs. The
above configuration file will ventilate logging into log files named
after the userid. 

- Added PropertyContainer interface
- Context interface now extends PropertyContainer
- InterpretationContext implements PropertyContainer
  It now has a field called propertiesMap which has precedence
  over values placed in the context
- InterpretationContext.getSubstitutionProperty was renamed as
  getProperty
- It is now possible to initialize a joran Interpreter with an initial
  (not empty) pattern

This is still very much ongoing work.
  
parent 5e9af127
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment