<div dir="ltr">I'm not positive but you might have to set additivity="true" (the default) for your "org.hibernate" logger so that both it and the root logger can process the message.  With additivity="false" only the most specific logger match will process the message.<div>  (*Chris*)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 21, 2015 at 5:52 AM, amit shah <span dir="ltr"><<a href="mailto:amits.84@gmail.com" target="_blank">amits.84@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:17.7272720336914px">I am trying to log messages from third party libraries to different file with the below logback extract</span><br><div><span style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:17.7272720336914px"><br></span></div><div><pre style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">appender name</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"CONSOLE"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">class</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"ch.qos.logback.core.ConsoleAppender"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">encoder</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
            </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">pattern</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">>%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">d</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">HH</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">mm</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">ss</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">SSS</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">}</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">%-</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">5level</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[%.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">45</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">thread</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)][%.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">32</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">logger</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">32</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">})]</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">msg</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">n</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">pattern</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">encoder</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">appender</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">

    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">timestamp key</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"byDay"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> datePattern</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"yyyyMMdd'T'HHmmss"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">/></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">

    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">appender name</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"FILE"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">class</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"ch.qos.logback.core.FileAppender"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">file</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">F</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">\v</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">\devel\logs\app</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">$</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">byDay</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">}.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">txt </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">file</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">append</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">true</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">append</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">encoder</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
            </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">pattern</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">>%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">d</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">HH</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">mm</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">ss</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">SSS</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">}</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">%-</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">5level</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[%.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">45</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">thread</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)][%.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">32</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">logger</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">32</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">})]</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">msg</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">%</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">n</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">pattern</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">encoder</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">appender</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">


    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><!--</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> ALL</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> INFO level </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">--></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">root level</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"INFO"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">appender</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">ref ref</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"CONSOLE"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">/></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">root</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">

    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><!--</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Third</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">party</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> some reduced levels </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">--></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">logger name</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"org.hibernate"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> level</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"TRACE"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> additivity</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"false"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">appender</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">ref ref</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">"FILE"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">/></span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"></</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">logger</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span></code></pre></div><div><span style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:17.7272720336914px">I want hibernate TRACE level logs to be logged to a file while other INFO messages should go to the console. The above xml config isn't working for me. Nothing gets logged to the file.</span><br></div><div><span style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:17.7272720336914px"><br></span></div><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:17.7272720336914px">Any suggestions?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:17.7272720336914px"><span style="line-height:17.7272720336914px">Thanks,<br></span><span style="line-height:17.7272720336914px">Amit</span></p></div></div>
<br>_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br></blockquote></div><br></div>