[ 
https://issues.apache.org/jira/browse/LOG4J2-551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13945462#comment-13945462
 ] 

Bohdan Mushkevych commented on LOG4J2-551:
------------------------------------------

Ralph

{code}${log.path}{code} is Maven value that is replaced during build-time.

While usage of 
{code}filePattern="${log.path}/$${date:yyyyMMdd}/%d{yyyyMMddHH}-${sd:type}-${hostName}.%i.log.gz"{code}
 seams more desirable, it causes error:

2014-03-24 11:18:53,540 DEBUG Calling createStrategy on class 
org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy for 
element DefaultRolloverStrategy with params(max="999", min="null", 
fileIndex="null", compressionLevel="null", 
Configuration(RoutingLoggingConfiguration))
2014-03-24 11:18:53,553 ERROR An exception occurred processing Appender Routing 
java.lang.StringIndexOutOfBoundsException: String index out of range: 90
        at java.lang.String.<init>(String.java:201)
        at 
org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:816)
        at 
org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:737)
        at 
org.apache.logging.log4j.core.lookup.StrSubstitutor.replace(StrSubstitutor.java:306)
        at 
org.apache.logging.log4j.core.config.BaseConfiguration.createPluginObject(BaseConfiguration.java:792)
        at 
org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:667)
        at 
org.apache.logging.log4j.core.appender.routing.RoutingAppender.createAppender(RoutingAppender.java:153)
        at 
org.apache.logging.log4j.core.appender.routing.RoutingAppender.getControl(RoutingAppender.java:137)
        at 
org.apache.logging.log4j.core.appender.routing.RoutingAppender.append(RoutingAppender.java:111)
        at 
org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:97)
        at 
org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:425)
        at 
org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:406)
        at 
org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:367)
        at org.apache.logging.log4j.core.Logger.log(Logger.java:112)
        at 
org.apache.logging.log4j.spi.AbstractLoggerWrapper.log(AbstractLoggerWrapper.java:121)
        at org.apache.logging.log4j.EventLogger.logEvent(EventLogger.java:56)


> TimeBasedTriggeringPolicy is not triggering file roll-over
> ----------------------------------------------------------
>
>                 Key: LOG4J2-551
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-551
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-rc1
>            Reporter: Bohdan Mushkevych
>         Attachments: log4j2.xml
>
>
> I am using log4j 2.0-rc1, StructuredDataMessage and EventLogger to perform 
> dynamic logging.
> Attached log4j2.xml configuration meant to:
> - rotate log files on hourly basis OR after file reaches 64 MB (whatever 
> comes first)
> - archive logs that does not satisfy the file pattern
> However, logging is performed on an "old" log minutes after new hour triggers:
> -rw-r--r--. 1 root root    96195 Feb 24 20:16 
> 2014022419-guid_info-mdmlocal.mobidia.com.log
> -rw-r--r--. 1 root root   827184 Feb 24 20:16 
> 2014022419-checkin-mdmlocal.mobidia.com.log
> Listing above shows, that last logging was performed to file 2014022419-*** 
> 16 minutes after filename was supposed to be changed to 2014022420-***



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to