In a multi-threaded application it is entirely possible that log entries might 
be appear to be out of order. This is because the LogEvent will populate the 
timestamp field but then another thread might get control, generate its log 
event, and then pass it to the appender before the first thread got a chance to 
pass the event to the appender. Are you seeing log entries that are out of 
order in the same thread? That shouldn’t happen.

Ralph

> On Dec 14, 2017, at 3:09 PM, Benjamin Jaton <benjamin.ja...@gmail.com> wrote:
> 
> Hello,
> 
> I am seeing logs that are not in order in the log file, it this expected
> when using a RollingFile appender?
> 
> "appenders" : {
>      "appender" : [ {
>        "type" : "RollingFile",
>        "name" : "ServerAppender",
>        "PatternLayout" : {
>          "pattern" : "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %c{1}:%L - %m%n"
>        },
>        "fileName" : "server.log",
>        "filePattern" : "server-%d{yyyy-MM-dd_HH-mm-ss}.log.zip",
>        "SizeBasedTriggeringPolicy" : {
>          "size" : "100MB"
>        },
>        "bufferedIO" : "true",
>        "bufferSize" : "8192",
>        "immediateFlush" : "true",
>        "DefaultRolloverStrategy" : (...)
>      }
> 
> Thanks
> Benjamin



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to