Why am i getting the error "does not contain a valid IntegerToken" when using lobback.xml

Posted on 2013-11-14
Last Modified: 2013-12-17
I changed the following line in logback.xml :

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


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

<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">

Now I am getting this error whenever my application tries to log :

  at java.lang.IllegalStateException: FileNamePattern [/var/log/iess/abc/abc__%d.log] does not contain a valid IntegerToken
        at      at ch.qos.logback.core.rolling.FixedWindowRollingPolicy.start(
        at      at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(
        at      at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(
        at      at ch.qos.logback.core.joran.spi.Interpreter.endElement(
        at      at ch.qos.logback.core.joran.spi.Interpreter.endElement(
        at      at
        at      at
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(
Question by:pvinodp
  • 2
  • 2
LVL 11

Expert Comment

ID: 39650535
I think you are getting space in date.
Check here sample for data pattern.
LVL 11

Expert Comment

ID: 39650537
Check for <timestamp key="bySecond" datePattern="yyyyMMdd'T'HHmmss"/>
LVL 35

Accepted Solution

mccarl earned 500 total points
ID: 39655104
Have you checked out the documentation for that Policy...

The second paragraph of that section gives you your answer (emphasis added by me)...
The fileNamePattern option represents the file name pattern for the archived (rolled over) log files. This option is required and must include an integer token %i somewhere within the pattern.
Therefore, you need to change the %d in your current fileNamePattern to be %i.

Author Closing Comment

ID: 39723192
LVL 35

Expert Comment

ID: 39723416
You're welcome!

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now