[logback-dev] [JIRA] Commented: (LBCLASSIC-42) Multiple applications sharing the same config file

Maarten Bosteels (JIRA) noreply-jira at qos.ch
Thu Nov 20 16:35:52 CET 2008


    [ http://jira.qos.ch/browse/LBCLASSIC-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10920#action_10920 ] 

Maarten Bosteels commented on LBCLASSIC-42:
-------------------------------------------

yes it works.

  public void initLogging() throws JoranException {
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    context.putProperty("appname", getApplicationName());
    JoranConfigurator jc = new JoranConfigurator();
    jc.setContext(context);
    context.shutdownAndReset();
    jc.doConfigure("./src/main/resources/logback-settings.xml");
  }

  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
    <file>/var/log/${appname}.log</file>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
    </layout>
  </appender>



> Multiple applications sharing the same config file
> --------------------------------------------------
>
>                 Key: LBCLASSIC-42
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-42
>             Project: logback-classic
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: unspecified
>         Environment: Operating System: Windows
> Platform: PC
> URL: http://marc.info/?t=120308330000003&r=1&w=2
>            Reporter: Ceki Gulcu
>            Assignee: Ceki Gulcu
>            Priority: Minor
>
> The idea is to have a number of applications (over 20) to share the same config file so that the log output goes to different files.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list