[JIRA] Created: (LBCLASSIC-312) SiftingAppender does not substitute variable value inside sift

View: New views
6 Messages — Rating Filter:   Alert me  

[JIRA] Created: (LBCLASSIC-312) SiftingAppender does not substitute variable value inside sift

by JIRA noreply-jira@qos.ch :: Rate this Message:

| View Threaded | Show Only this Message

SiftingAppender does not substitute variable value inside sift
--------------------------------------------------------------

                 Key: LBCLASSIC-312
                 URL: http://jira.qos.ch/browse/LBCLASSIC-312
             Project: logback-classic
          Issue Type: Bug
          Components: appender
    Affects Versions: 1.0.0
         Environment: Ubuntu 11.04,  Eclipse 3.7
            Reporter: Dmitrius Listo
            Assignee: Logback dev list


Faced a probable bug (at least, did not find any mention about such issue at manual/google/other bugs in category).

Brief logging configuration description:
I have a property defined in my logback configuration.
There is a property with log file location defined:
<property name="LOG_HOME" value="/tmp/aicore" />
Also, I have ConsoleAppender and two RollingFileAppender appenders, attached to root logger.  RollingFileAppender configuration contains LOG_HOME variable in path and substitution is done without any issues, log file is created and updated.
But when I add SiftingAppender (log files are created on per-threadId basis), that contains FileAppender in it's sift section, variable value is not substituted.
Here is the logback log fragment, generated using OnConsoleStatusListener:

22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE-server]
22:11:27,398 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
22:11:27,400 |-INFO in ch.qos.logback.core.FileAppender[FILE-server] - File property is set to [LOG_HOME_IS_UNDEFINED/thread-server.log]

Note the "LOG_HOME_IS_UNDEFINED/thread-server.log" value. As a result, no any sift log file is created in expected location. When I substitute ${LOG_HOME} value manually, everything works well.

Below is my SiftingAppender config:

        <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
                <discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
                        <key>threadId</key>
                        <defaultValue>unclassified</defaultValue>
                </discriminator>
                <sift>
                        <appender name="FILE-${threadId}" class="ch.qos.logback.core.FileAppender">
                        <file>${LOG_HOME}/thread-${threadId}.log</file>
                        <append>false</append>
                       <encoder>
                          <pattern>%d [%thread] %level %mdc %logger{35} - %msg%n</pattern>
                        </encoder>
           </appender>
                </sift>
        </appender>

Sorry if bug report is not formed perfectly, I have not much expertise yet :)

--
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

       
_______________________________________________
logback-dev mailing list
logback-dev@...
http://mailman.qos.ch/mailman/listinfo/logback-dev

[JIRA] Updated: (LBCLASSIC-312) SiftingAppender does not substitute variable value inside sift

by JIRA noreply-jira@qos.ch :: Rate this Message:

| View Threaded | Show Only this Message


     [ http://jira.qos.ch/browse/LBCLASSIC-312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitrius Listo updated LBCLASSIC-312:
-------------------------------------

    Attachment: logback.xml

My logback configuration

> SiftingAppender does not substitute variable value inside sift
> --------------------------------------------------------------
>
>                 Key: LBCLASSIC-312
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-312
>             Project: logback-classic
>          Issue Type: Bug
>          Components: appender
>    Affects Versions: 1.0.0
>         Environment: Ubuntu 11.04,  Eclipse 3.7
>            Reporter: Dmitrius Listo
>            Assignee: Logback dev list
>         Attachments: logback.xml
>
>
> Faced a probable bug (at least, did not find any mention about such issue at manual/google/other bugs in category).
> Brief logging configuration description:
> I have a property defined in my logback configuration.
> There is a property with log file location defined:
> <property name="LOG_HOME" value="/tmp/aicore" />
> Also, I have ConsoleAppender and two RollingFileAppender appenders, attached to root logger.  RollingFileAppender configuration contains LOG_HOME variable in path and substitution is done without any issues, log file is created and updated.
> But when I add SiftingAppender (log files are created on per-threadId basis), that contains FileAppender in it's sift section, variable value is not substituted.
> Here is the logback log fragment, generated using OnConsoleStatusListener:
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE-server]
> 22:11:27,398 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
> 22:11:27,400 |-INFO in ch.qos.logback.core.FileAppender[FILE-server] - File property is set to [LOG_HOME_IS_UNDEFINED/thread-server.log]
> Note the "LOG_HOME_IS_UNDEFINED/thread-server.log" value. As a result, no any sift log file is created in expected location. When I substitute ${LOG_HOME} value manually, everything works well.
> Below is my SiftingAppender config:
> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
> <discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
> <key>threadId</key>
> <defaultValue>unclassified</defaultValue>
> </discriminator>
> <sift>
> <appender name="FILE-${threadId}" class="ch.qos.logback.core.FileAppender">
>        <file>${LOG_HOME}/thread-${threadId}.log</file>
>        <append>false</append>
>       <encoder>
>          <pattern>%d [%thread] %level %mdc %logger{35} - %msg%n</pattern>
>        </encoder>
>            </appender>
> </sift>
> </appender>
> Sorry if bug report is not formed perfectly, I have not much expertise yet :)

--
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

       
_______________________________________________
logback-dev mailing list
logback-dev@...
http://mailman.qos.ch/mailman/listinfo/logback-dev

[JIRA] Updated: (LBCLASSIC-312) SiftingAppender does not substitute variable value inside sift

by JIRA noreply-jira@qos.ch :: Rate this Message:

| View Threaded | Show Only this Message


     [ http://jira.qos.ch/browse/LBCLASSIC-312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitrius Listo updated LBCLASSIC-312:
-------------------------------------

    Attachment: log.txt

Text fragment containing full logback initialisation log

> SiftingAppender does not substitute variable value inside sift
> --------------------------------------------------------------
>
>                 Key: LBCLASSIC-312
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-312
>             Project: logback-classic
>          Issue Type: Bug
>          Components: appender
>    Affects Versions: 1.0.0
>         Environment: Ubuntu 11.04,  Eclipse 3.7
>            Reporter: Dmitrius Listo
>            Assignee: Logback dev list
>         Attachments: log.txt, logback.xml
>
>
> Faced a probable bug (at least, did not find any mention about such issue at manual/google/other bugs in category).
> Brief logging configuration description:
> I have a property defined in my logback configuration.
> There is a property with log file location defined:
> <property name="LOG_HOME" value="/tmp/aicore" />
> Also, I have ConsoleAppender and two RollingFileAppender appenders, attached to root logger.  RollingFileAppender configuration contains LOG_HOME variable in path and substitution is done without any issues, log file is created and updated.
> But when I add SiftingAppender (log files are created on per-threadId basis), that contains FileAppender in it's sift section, variable value is not substituted.
> Here is the logback log fragment, generated using OnConsoleStatusListener:
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE-server]
> 22:11:27,398 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
> 22:11:27,400 |-INFO in ch.qos.logback.core.FileAppender[FILE-server] - File property is set to [LOG_HOME_IS_UNDEFINED/thread-server.log]
> Note the "LOG_HOME_IS_UNDEFINED/thread-server.log" value. As a result, no any sift log file is created in expected location. When I substitute ${LOG_HOME} value manually, everything works well.
> Below is my SiftingAppender config:
> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
> <discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
> <key>threadId</key>
> <defaultValue>unclassified</defaultValue>
> </discriminator>
> <sift>
> <appender name="FILE-${threadId}" class="ch.qos.logback.core.FileAppender">
>        <file>${LOG_HOME}/thread-${threadId}.log</file>
>        <append>false</append>
>       <encoder>
>          <pattern>%d [%thread] %level %mdc %logger{35} - %msg%n</pattern>
>        </encoder>
>            </appender>
> </sift>
> </appender>
> Sorry if bug report is not formed perfectly, I have not much expertise yet :)

--
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

       
_______________________________________________
logback-dev mailing list
logback-dev@...
http://mailman.qos.ch/mailman/listinfo/logback-dev

[JIRA] Commented: (LBCLASSIC-312) SiftingAppender does not substitute variable value inside sift

by JIRA noreply-jira@qos.ch :: Rate this Message:

| View Threaded | Show Only this Message


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

Dmitrius Listo commented on LBCLASSIC-312:
------------------------------------------

UPD. Just tried to substitute ${LOG_PATTERN} into sifted appender. Got "LOG_PATTERN_IS_UNDEFINED" instead of log statements. It looks like property substitution inside sifted uppender is broken at all.

> SiftingAppender does not substitute variable value inside sift
> --------------------------------------------------------------
>
>                 Key: LBCLASSIC-312
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-312
>             Project: logback-classic
>          Issue Type: Bug
>          Components: appender
>    Affects Versions: 1.0.0
>         Environment: Ubuntu 11.04,  Eclipse 3.7
>            Reporter: Dmitrius Listo
>            Assignee: Logback dev list
>         Attachments: log.txt, logback.xml
>
>
> Faced a probable bug (at least, did not find any mention about such issue at manual/google/other bugs in category).
> Brief logging configuration description:
> I have a property defined in my logback configuration.
> There is a property with log file location defined:
> <property name="LOG_HOME" value="/tmp/aicore" />
> Also, I have ConsoleAppender and two RollingFileAppender appenders, attached to root logger.  RollingFileAppender configuration contains LOG_HOME variable in path and substitution is done without any issues, log file is created and updated.
> But when I add SiftingAppender (log files are created on per-threadId basis), that contains FileAppender in it's sift section, variable value is not substituted.
> Here is the logback log fragment, generated using OnConsoleStatusListener:
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE-server]
> 22:11:27,398 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
> 22:11:27,400 |-INFO in ch.qos.logback.core.FileAppender[FILE-server] - File property is set to [LOG_HOME_IS_UNDEFINED/thread-server.log]
> Note the "LOG_HOME_IS_UNDEFINED/thread-server.log" value. As a result, no any sift log file is created in expected location. When I substitute ${LOG_HOME} value manually, everything works well.
> Below is my SiftingAppender config:
> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
> <discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
> <key>threadId</key>
> <defaultValue>unclassified</defaultValue>
> </discriminator>
> <sift>
> <appender name="FILE-${threadId}" class="ch.qos.logback.core.FileAppender">
>        <file>${LOG_HOME}/thread-${threadId}.log</file>
>        <append>false</append>
>       <encoder>
>          <pattern>%d [%thread] %level %mdc %logger{35} - %msg%n</pattern>
>        </encoder>
>            </appender>
> </sift>
> </appender>
> Sorry if bug report is not formed perfectly, I have not much expertise yet :)

--
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

       
_______________________________________________
logback-dev mailing list
logback-dev@...
http://mailman.qos.ch/mailman/listinfo/logback-dev

[JIRA] Commented: (LBCLASSIC-312) SiftingAppender does not substitute variable value inside sift

by JIRA noreply-jira@qos.ch :: Rate this Message:

| View Threaded | Show Only this Message


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

Dieter Mueller commented on LBCLASSIC-312:
------------------------------------------

Hello,

I faced just yesterday the same problem on logback 1.0.0.
My Environment: java 1.6.0_07-b06, Windows7.

In logback 0.9.26 it workes fine.

Dieter Mueller.

> SiftingAppender does not substitute variable value inside sift
> --------------------------------------------------------------
>
>                 Key: LBCLASSIC-312
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-312
>             Project: logback-classic
>          Issue Type: Bug
>          Components: appender
>    Affects Versions: 1.0.0
>         Environment: Ubuntu 11.04,  Eclipse 3.7
>            Reporter: Dmitrius Listo
>            Assignee: Logback dev list
>         Attachments: log.txt, logback.xml
>
>
> Faced a probable bug (at least, did not find any mention about such issue at manual/google/other bugs in category).
> Brief logging configuration description:
> I have a property defined in my logback configuration.
> There is a property with log file location defined:
> <property name="LOG_HOME" value="/tmp/aicore" />
> Also, I have ConsoleAppender and two RollingFileAppender appenders, attached to root logger.  RollingFileAppender configuration contains LOG_HOME variable in path and substitution is done without any issues, log file is created and updated.
> But when I add SiftingAppender (log files are created on per-threadId basis), that contains FileAppender in it's sift section, variable value is not substituted.
> Here is the logback log fragment, generated using OnConsoleStatusListener:
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE-server]
> 22:11:27,398 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
> 22:11:27,400 |-INFO in ch.qos.logback.core.FileAppender[FILE-server] - File property is set to [LOG_HOME_IS_UNDEFINED/thread-server.log]
> Note the "LOG_HOME_IS_UNDEFINED/thread-server.log" value. As a result, no any sift log file is created in expected location. When I substitute ${LOG_HOME} value manually, everything works well.
> Below is my SiftingAppender config:
> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
> <discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
> <key>threadId</key>
> <defaultValue>unclassified</defaultValue>
> </discriminator>
> <sift>
> <appender name="FILE-${threadId}" class="ch.qos.logback.core.FileAppender">
>        <file>${LOG_HOME}/thread-${threadId}.log</file>
>        <append>false</append>
>       <encoder>
>          <pattern>%d [%thread] %level %mdc %logger{35} - %msg%n</pattern>
>        </encoder>
>            </appender>
> </sift>
> </appender>
> Sorry if bug report is not formed perfectly, I have not much expertise yet :)

--
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

       
_______________________________________________
logback-dev mailing list
logback-dev@...
http://mailman.qos.ch/mailman/listinfo/logback-dev

[JIRA] Commented: (LBCLASSIC-312) SiftingAppender does not substitute variable value inside sift

by JIRA noreply-jira@qos.ch :: Rate this Message:

| View Threaded | Show Only this Message


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

Dieter Mueller commented on LBCLASSIC-312:
------------------------------------------

Perhaps not a bug!

Today I accidentally stumbled across the release notes of logback 1.0.0 (when reading the release notes of 1.0.1.):

"Breaking change: properties are no longer automatically inserted into the context"
and a link to http://logback.qos.ch/manual/configuration.html#variableSubstitution.

When I changed the property-definition to scope="context", then the property substitution
worked within the SiftingAppender.

So this showstopper is for us removed, we may move to logback 1.0.1.

BTW:
For me it is not 100% clear, what the difference between scope="local" and scope="context" is:
Within the file name of the "normal" appenders it works with "local", but only within the SiftingAppender "context" is needed.

Hope this helped,

Dieter Mueller

> SiftingAppender does not substitute variable value inside sift
> --------------------------------------------------------------
>
>                 Key: LBCLASSIC-312
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-312
>             Project: logback-classic
>          Issue Type: Bug
>          Components: appender
>    Affects Versions: 1.0.0
>         Environment: Ubuntu 11.04,  Eclipse 3.7
>            Reporter: Dmitrius Listo
>            Assignee: Logback dev list
>         Attachments: log.txt, logback.xml
>
>
> Faced a probable bug (at least, did not find any mention about such issue at manual/google/other bugs in category).
> Brief logging configuration description:
> I have a property defined in my logback configuration.
> There is a property with log file location defined:
> <property name="LOG_HOME" value="/tmp/aicore" />
> Also, I have ConsoleAppender and two RollingFileAppender appenders, attached to root logger.  RollingFileAppender configuration contains LOG_HOME variable in path and substitution is done without any issues, log file is created and updated.
> But when I add SiftingAppender (log files are created on per-threadId basis), that contains FileAppender in it's sift section, variable value is not substituted.
> Here is the logback log fragment, generated using OnConsoleStatusListener:
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
> 22:11:27,396 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE-server]
> 22:11:27,398 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
> 22:11:27,400 |-INFO in ch.qos.logback.core.FileAppender[FILE-server] - File property is set to [LOG_HOME_IS_UNDEFINED/thread-server.log]
> Note the "LOG_HOME_IS_UNDEFINED/thread-server.log" value. As a result, no any sift log file is created in expected location. When I substitute ${LOG_HOME} value manually, everything works well.
> Below is my SiftingAppender config:
> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
> <discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
> <key>threadId</key>
> <defaultValue>unclassified</defaultValue>
> </discriminator>
> <sift>
> <appender name="FILE-${threadId}" class="ch.qos.logback.core.FileAppender">
>        <file>${LOG_HOME}/thread-${threadId}.log</file>
>        <append>false</append>
>       <encoder>
>          <pattern>%d [%thread] %level %mdc %logger{35} - %msg%n</pattern>
>        </encoder>
>            </appender>
> </sift>
> </appender>
> Sorry if bug report is not formed perfectly, I have not much expertise yet :)

--
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

       
_______________________________________________
logback-dev mailing list
logback-dev@...
http://mailman.qos.ch/mailman/listinfo/logback-dev