<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi,<div><br></div><div>Just discovered my mistake... my '<span style="font-size: 10pt; ">log_dir</span><span style="font-size: 10pt; ">' was missing scope definition, the breaking change from 1.0.</span></div><div><span style="font-size: 10pt; ">I really don't know how it went unnoticed while using 1.0, maybe I upgraded to 1.0 without proper testing.</span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; ">As a note, maybe adding some warning info during logback startup could be useful on such situations, when a variable is missing. I had similar issues a couple times, because of typos or some missing startup argument, and I usually realized my mistake by stumbling on the "_is_undefined" folder (like now).</span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; ">Thanks for your time, ceki.</span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; ">Kind regards.</span></div><div><br><div><div id="SkyDrivePlaceholder"></div>> Date: Tue, 10 Apr 2012 23:30:36 +0200<br>> From: ceki@qos.ch<br>> To: logback-user@qos.ch<br>> Subject: Re: [logback-user] SiftingAppender not working<br>> <br>> <br>> Could you provide the whole configuration file please?<br>> <br>> On 10.04.2012 19:58, Y M wrote:<br>> > (Sorry, message issues, trying again)<br>> ><br>> ><br>> > Hello,<br>> ><br>> > I had this code well tested when I wrote it months ago, but now it is failing. The only issue is the SiftingAppender:<br>> ><br>> ><br>> > <appender name="SIFTING" class="ch.qos.logback.classic.sift.SiftingAppender"><br>> ><br>> > <discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator"><br>> ><br>> > <key>userId</key><br>> ><br>> > <defaultValue>none</defaultValue><br>> ><br>> > </discriminator><br>> ><br>> > <sift><br>> ><br>> > <appender name="SIFTING-${userId}" class="ch.qos.logback.core.rolling.RollingFileAppender"><br>> ><br>> > <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><br>> ><br>> > <fileNamePattern>${log_dir}/sifting/log.${userId}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern><br>> ><br>> > <maxHistory>30</maxHistory><br>> ><br>> > <cleanHistoryOnStart>true</cleanHistoryOnStart><br>> ><br>> > <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"><br>> ><br>> > <maxFileSize>25MB</maxFileSize><br>> ><br>> > </timeBasedFileNamingAndTriggeringPolicy><br>> ><br>> > </rollingPolicy><br>> ><br>> > <encoder><pattern>%date %-5level %logger %X{userId} - %message%n%xThrowable{full}</pattern></encoder><br>> ><br>> > </appender><br>> ><br>> > </sift><br>> ><br>> > </appender><br>> ><br>> ><br>> > It is simply not logging anything at all. The startup info is short, maybe indicating that it is not being properly initialized:<br>> ><br>> > 10:29:18,102 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[MAIN] - File property is set to [null]<br>> ><br>> > 10:29:18,102 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.sift.SiftingAppender]<br>> ><br>> > 10:29:18,107 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [SIFTING]<br>> ><br>> > 10:29:18,107 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [package.project.x] to false<br>> ><br>> > ...<br>> ><br>> > 10:29:18,727 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN<br>> ><br>> > 10:29:18,727 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [MAIN] to Logger[ROOT]<br>> ><br>> > 10:29:18,727 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [SIFTING] to Logger[package.project]<br>> ><br>> > 10:29:18,727 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.<br>> ><br>> ><br>> > I was upgrading from logback 1.0 to 1.0.1 to use 'cleanHistoryOnStart' when I noticed this. I rolled back to 1.0, but nothing changed. Following other mails and messages around, I tried my RollingFileAppender by itself, and it works fine. The MDC is also fine, as it is printed in my other appenders. I also used<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> , but nothing useful.<br>> ><br>> ><br>> > Right now I have no idea how to proceed or how can I investigate this further.<br>> ><br>> > Any help is appreciated.<br>> ><br>> ><br>> > Thanks!<br>> ><br>> <br>> <br>> -- <br>> Ceki<br>> http://twitter.com/#!/ceki<br>> _______________________________________________<br>> Logback-user mailing list<br>> Logback-user@qos.ch<br>> http://mailman.qos.ch/mailman/listinfo/logback-user<br></div></div> </div></body>
</html>