2

I imported a third-party library into my Java/Spring project (just importing, nothing from the library is used) and when I run the app I get:

ERROR in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@1aea858e - Missing integer token, that is %i, in FileNamePattern [jboss.server.log.dir_IS_UNDEFINED/bak-library-%d{yyyy-MM}.log.zip]
ERROR in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@1aea858e - See also http://logback.qos.ch/codes.html#sat_missing_integer_token
    at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:152)
    at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:195)
    at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:65)
    at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:50)

I was wondering - is this an issue with the third-party library itself or I can add some configuration in my project in order to fix this (basically the library assumes that a client will provide such configuration so it throws an error if there isn't)?

asenovm
  • 6,397
  • 2
  • 41
  • 52

2 Answers2

2

Following the link in the exception you find

Missing integer token, that is %i, in FileNamePattern [...].

The %i conversion token is mandatory for size and time based archiving. In case the %i token is missing, SizeAndTimeBasedFNATP attached to RollingFileAppender will detect the omission and will not start.

As you use a RollingFileAppender you follow the above link size and time based archiving

Changing your pattern for example as following should solve the problem.

jboss.server.log.dir_IS_UNDEFINED/bak-library-%d{yyyy-MM}.%i.log.zip
SubOptimal
  • 22,518
  • 3
  • 53
  • 69
  • Thanks! But where do I change this? The error comes from a third-party library and I don't have its source code. If I put logback configuration in my project will it affect the logging of the library? – asenovm Sep 02 '16 at 09:59
  • @asenovm I would expect that your library mention in its documentation where you need to store the logback configuration. Where is this file pattern `bak-library-%d{yyyy-MM}.log.zip` defined? – SubOptimal Sep 02 '16 at 10:07
0

From the exception, I think the problem is, it is not able to parse this

jboss.server.log.dir_IS_UNDEFINED

It is not able to load this property that leads to an exception.

Shaggy
  • 596
  • 1
  • 6
  • 15