[logback-user] Log Rotation Fails on Windows if Using JNDI

Scott Dudley scott at telesoft.com
Thu Nov 3 17:47:36 CET 2011

I just discovered that log rotation fails on Windows if using 
ContextJNDISelector.  I've tried both FixedWindowRollingPolicy and 
TimeBasedRollingPolicy with the same outcome.  If I disable JNDI, I lose 
the contextName but rotation occurs as expected.

Here's the error I get:

12:22:36,006 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming 
file [c:\telmast6\soft\apache-tomcat-6.0.24\logs\debug.log] to 
12:22:36,006 |-WARN in c.q.l.co.rolling.helper.RenameUtil - Failed to 
rename file [c:\telmast6\soft\apache-tomcat-6.0.24\logs\debug.log] to 
12:22:36,006 |-WARN in c.q.l.co.rolling.helper.RenameUtil - Please 
consider leaving the [file] option of RollingFileAppender empty.
12:22:36,006 |-WARN in c.q.l.co.rolling.helper.RenameUtil - See also 

And here is my logback.xml file:

<configuration scan="true" scanPeriod="30 seconds">

<appender name="FILE" 

<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">


<root level="DEBUG">
<appender-ref ref="FILE" />


The logback and slf4j resources must be loaded by the servlet container 
classloader (multiple reasons) and this is also desirable as we want to 
funnel all logging into a single file however, we also need to know 
which application generated the call - er go our use of JNDI (MDC 
wouldn't work).

By the way, this is a Windows-only issue.  Works splendidly on Linux.


Scott Dudley
Senior Developer

Telesoft Corp. | 1661 E. Camelback Rd., Suite 300 | Phoenix, AZ, 85016

More information about the Logback-user mailing list