<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
We are currently deploying the following logback jar files to all
tomcat instances:<br>
<br>
logback-access-1.0.13.jar<br>
logback-classic-1.0.13<br>
logback-core-1.0.13<br>
<br>
These libraries are currently deployed by Puppet to all Tomcat
instances via the twc_tomcat module and are placed in the
$CATALINA_HOME/lib directory to be accessible by all contexts.
Additionally we are deploying puppet template (full variable and
settings control) files for tomcat7.conf, server.xml,
logback-access.xml, logback.xml, log4j.properties, and
inbound/outbound-api-runtime.properties files to the
$CATALINA_HOME/conf (alias) /etc/tomcat7 config directories.<br>
<br>
If you keep a localhost version of the required configuration files
in your WAR and then reference the external files (-Dconfig
references) as preferred you will avoid any compiler errors while
still allowing automated control of these properties. We are also
leveraging logrotate to ensure that files are maintained for a
reasonable period but do not grow large enough to kill the node, and
will be leveraging rsyslogd to eventually push copies of log
messages to Logstash on a remote cluster.<br>
<br>
Hopefully this helps.<br>
<br>
<div class="moz-cite-prefix">On 9/19/13 10:57 AM, Christopher Holt
wrote:<br>
</div>
<blockquote
cite="mid:CAFV69w=EvzAp+zWx7pwAS7rq4qkvjwKu1FDrLapWCgz+69dBSQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>David,</div>
<div><br>
</div>
If I move all of the logback, log4j, etc jars to tomcat/lib,
then it fails to find the logback.xml in my
conf/Catalina/localhost directory.
<div><br>
</div>
<div>Jars involved:</div>
<div><br>
</div>
<div>
<div>jcl-over-slf4j-1.7.5.jar</div>
<div>jul-to-slf4j-1.7.5.jar</div>
<div>log4j-over-slf4j-1.7.5.jar</div>
<div>logback-access-1.0.13.jar</div>
<div>logback-classic-1.0.13.jar</div>
<div>logback-core-1.0.13.jar</div>
<div>slf4j-api-1.7.5.jar</div>
</div>
<div><br>
</div>
<div>I really want to keep the logback.xml config out of the war
files. Different deployments will have different logging
strategies. I also need separate logback.xml's per tomcat
instance. Where can I keep my config so that it can be seen
when the logback jars are not in the wars?</div>
<div><br>
</div>
<div>Thanks,<br>
</div>
<div>-Chris</div>
<div><br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, Sep 19, 2013 at 3:53 AM,
David Roussel <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:nabble@diroussel.xsmail.com"
target="_blank">nabble@diroussel.xsmail.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="auto">
<div>Where is logback on the class path? If it is in the
wars, try taking it out and putting it in the tomcat
class path. <br>
<br>
David</div>
<div>
<div class="h5">
<div><br>
On 18 Sep 2013, at 16:30, Christopher Holt <<a
moz-do-not-send="true"
href="mailto:chris.holt@hcs.us.com"
target="_blank">chris.holt@hcs.us.com</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">Hello,
<div><br>
</div>
<div>I have logback configured so that code
bundled in 2 different war files under
tomcat will write to the same log file which
rolls daily. It's also marked as prudent.
I believe my configuration follows the
guidelines from (<a moz-do-not-send="true"
href="http://logback.qos.ch/manual/appenders.html#prudentWithRolling"
target="_blank">http://logback.qos.ch/manual/appenders.html#prudentWithRolling</a>).
</div>
<div><br>
</div>
<div>
<div><configuration></div>
<div> <appender name="A1"
class="ch.qos.logback.core.rolling.RollingFileAppender"><br>
</div>
<div> <prudent>true</prudent></div>
<div> <encoder></div>
<div> <pattern>%d{dd-MM
HH:mm:ss} [%t] %c %5p %m%n</pattern></div>
<div> </encoder></div>
<div> <rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"></div>
<div>
<FileNamePattern>${catalina.base}/logs/myapp.%d{yyyy-MM-dd}.log</FileNamePattern></div>
<div>
<MaxHistory>30</MaxHistory></div>
<div> </rollingPolicy></div>
<div> </appender></div>
<div><br>
</div>
<div> <root level="INFO"><br>
</div>
<div> <appender-ref ref="A1"/></div>
<div> </root></div>
<div></configuration></div>
<div><br>
</div>
<div>My problem is that I get lots
of java.nio.channels.OverlappingFileLockException.</div>
<div>...<br>
</div>
<div>java.nio.channels.FileChannel.lock(FileChannel.java:860)<br>
</div>
<div>
<div>ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:187)</div>
<div>ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204)</div>
<div>ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212)</div>
</div>
<div>...</div>
<div><br>
</div>
<div>After reading the docs for
OverlappingFileLockException, my hunch is
that the 2 different loggers, loaded by
different class loaders within the same
JVM are both trying to lock the file,
unbeknownst to each other. This violates
the rules for FileChannel.lock, which seem
to ignore the issue of locks among
multiple class loaders within 1 JVM.</div>
<div><br>
</div>
<div>Has anyone run into this issue before?
Is there a simple workaround that I'm not
thinking of?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Chris<br>
</div>
<div dir="ltr">
<div><br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
<blockquote type="cite">
<div><span>_______________________________________________</span><br>
<span>Logback-user mailing list</span><br>
<span><a moz-do-not-send="true"
href="mailto:Logback-user@qos.ch"
target="_blank">Logback-user@qos.ch</a></span><br>
<span><a moz-do-not-send="true"
href="http://mailman.qos.ch/mailman/listinfo/logback-user"
target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a></span></div>
</blockquote>
</div>
<br>
_______________________________________________<br>
Logback-user mailing list<br>
<a moz-do-not-send="true"
href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a moz-do-not-send="true"
href="http://mailman.qos.ch/mailman/listinfo/logback-user"
target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Logback-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a>
<a class="moz-txt-link-freetext" href="http://mailman.qos.ch/mailman/listinfo/logback-user">http://mailman.qos.ch/mailman/listinfo/logback-user</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
James E. Scollard III
Senior Cloud Systems Architect
c: 615.730.4387
<a class="moz-txt-link-abbreviated" href="http://www.weather.com">www.weather.com</a>
View my profile on LinkedIn
</pre>
</body>
</html>