[logback-user] FileNamePattern [] does not contain a valid DateToken

Ceki Gülcü ceki at qos.ch
Wed Jan 12 17:19:50 CET 2011


Hello Jonas,

It looks good to me. Here are few suggestions:

1) Try the latest version of logback
2) In FileNamePattern change all backward slashes to forward slashes
HTH,

On 12/01/2011 2:31 PM, Jonas Pacheco wrote:
> Forgot to mention: logback-0.9.19
>
> 2011/1/12 Jonas Pacheco<jonas at kidux.com.br>:
>> I'm having a 'FileNamePattern [] does not contain a valid DateToken'
>> exception on run time. This happens only on Windows 7 x64 running on a
>> JVM x86 or x64.
>>
>> My configuration file:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <configuration>
>>         <appender name="APP" class="ch.qos.logback.core.rolling.RollingFileAppender">
>>         <File>${APP_HOME}\logs\app\app.log</File>
>>                 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>>                 <FileNamePattern>${APP_HOME}\logs\app\app.%d.gz</FileNamePattern>
>>                 <MaxHistory>30</MaxHistory>
>>         </rollingPolicy>
>>         <layout class="ch.qos.logback.classic.PatternLayout">
>>                 <Pattern>%-5level %date{dd/MM/yy HH:mm:ss}  [%thread]
>> %logger{20} - %X{state} - %X{identity}%n%msg%n%n</Pattern>
>>         </layout>
>>         </appender>
>>         <logger name="net.app"
>>                                 additivity="false"
>>                                 level="debug">
>>         <appender-ref ref="APP"/>
>>         </logger>
>>         <root level="info">
>>                 <appender-ref ref="APP"/>
>>         </root>
>> </configuration>
>>
>> Stdout information:
>>
>> 09:54:48,807 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
>> - About to instantiate appender of type
>> [ch.qos.logback.core.rolling.RollingFileAppender]
>> 09:54:48,807 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
>> - Naming appender as [APP]
>> 09:54:48,901 |-INFO in
>> ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Pushing
>> component [rollingPolicy] on top of the object stack.
>> 09:54:48,901 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy -
>> Adding parent to RollingPolicy: APP
>> 09:54:48,948 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy -
>> Will use gz compression
>> 09:54:48,948 |-ERROR in
>> ch.qos.logback.core.joran.spi.Interpreter at 11:22 - RuntimeException in
>> Action for tag [rollingPolicy] java.lang.IllegalStateException:
>> FileNamePattern [C:\Program Files (x86)\app\logs\app\app.%d.gz] does
>> not contain a valid DateToken
>>         at java.lang.IllegalStateException: FileNamePattern
>> [C:\Program Files (x86)\app\logs\app\app.%d.gz] does not contain a
>> valid DateToken
>>         at      at
>> ch.qos.logback.core.rolling.TimeBasedRollingPolicy.start(TimeBasedRollingPolicy.java:87)
>>         at      at
>> ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:159)
>>         at      at
>> ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:307)
>>         at      at
>> ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:187)
>>         at      at
>> ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:174)
>>         at      at
>> ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:48)
>>         at      at
>> ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:324)
>>         at      at
>> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:109)
>>         at      at
>> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:76)
>>         at      at
>> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:40)
>>         at      at
>> ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:47)
>>         at      at
>> ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:108)
>>         at      at
>> org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
>>         at      at
>> org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:56)
>>         at      at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:189)
>>         at      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:112)
>>         at      at
>> org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:105)
>>         at      at
>> org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:235)
>>         at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:208)
>>         at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:221)
>>         at      at
>> br.com.ibnetwork.xingu.container.impl.ContainerSupport.<init>(ContainerSupport.java:23)
>>         at      at
>> br.com.ibnetwork.xingu.container.impl.Pulga.<init>(Pulga.java:39)
>>         at      at
>> br.com.ibnetwork.xingu.container.ContainerUtils.createContainer(ContainerUtils.java:70)
>>         at      at
>> br.com.ibnetwork.xingu.container.ContainerUtils.getContainer(ContainerUtils.java:62)
>>         at      at app.daemon.DaemonRunner.configure(DaemonRunner.java:42)
>>         at      at app.daemon.DaemonRunner.main(DaemonRunner.java:61)
>>         at      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>         at      at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>         at      at java.lang.reflect.Method.invoke(Unknown Source)
>>         at      at app.Launcher.launch(Launcher.java:42)
>>         at      at app.Launcher.main(Launcher.java:26)
>> 09:54:48,948 |-ERROR in
>> ch.qos.logback.core.joran.spi.Interpreter at 13:59 - no applicable action
>> for [layout], current pattern is[[configuration][appender][layout]]
>> 09:54:48,948 |-ERROR in
>> ch.qos.logback.core.joran.spi.Interpreter at 14:18 - no applicable action
>> for [Pattern], current pattern is
>> [[configuration][appender][layout][Pattern]]
>>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user



More information about the Logback-user mailing list