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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

734 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