[ 
http://issues.apache.org/jira/browse/LOG4NET-84?page=comments#action_12424196 ] 
            
Nicko Cadell commented on LOG4NET-84:
-------------------------------------

The LoggingEvent captures the event TimeStamp as close as possible to when the 
event occurred, not when it is written to a log file (which is the job of an 
appender). 

If you want your log file to contain the time the log event is written to the 
file, rather than the time the event occurs, then you can use the following 
layout in your appender configuration:


<layout type="log4net.Layout.PatternLayout">
  <converter>
    <name value="datenow" />
    <type 
value="log4net.Util.PatternStringConverters.DatePatternConverter,log4net" />
  </converter>

  <conversionPattern value="%datenow [%thread] %-5level %logger - 
%message%newline" />
</layout>

> Allow messages to be printed in ascendant order according to date time.
> -----------------------------------------------------------------------
>
>                 Key: LOG4NET-84
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-84
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>            Priority: Minor
>
> In multi threading application, when letting log4net to print time 
> information before every message (for example with %d{HH:mm:ss.fff} layout), 
> it might print the messages not according to ascendant order.
> The reason is that the date time information is taken from 
> LoggingEventData.TimeStamp field that is update to Now before the 
> synchronization phase.
> That is only semantic issue, but it cause inconveniency to many.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to