You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Tal G (JIRA)" <ji...@apache.org> on 2006/07/25 09:44:14 UTC

[jira] Created: (LOG4NET-84) Allow messages to be printed in ascendant order according to date time.

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

        

[jira] Commented: (LOG4NET-84) Allow messages to be printed in ascendant order according to date time.

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-84?page=comments#action_12423484 ] 
            
Ron Grabowski commented on LOG4NET-84:
--------------------------------------

I don't understand what the problem is or your solution to it. Multi-threaded applications usually don't make guarantee as to the order that worker threads are processed.

> 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

        

[jira] Closed: (LOG4NET-84) Allow messages to be printed in ascendant order according to date time.

Posted by "Nicko Cadell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LOG4NET-84?page=all ]

Nicko Cadell closed LOG4NET-84.
-------------------------------

    Resolution: Invalid
      Assignee: Nicko Cadell

Closing this issue as invalid because it is a usage requirement that can be resolved by correct configuration of log4net. No further action required.

> 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
>         Assigned To: Nicko Cadell
>            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

        

[jira] Commented: (LOG4NET-84) Allow messages to be printed in ascendant order according to date time.

Posted by "Tal G (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-84?page=comments#action_12423535 ] 
            
Tal G commented on LOG4NET-84:
------------------------------

I find myself again and again need to explain to others why a message with later time is located in the log file before a message with earlier time.
So I solved the problem by taking the Now instead of loggingEvent.TimeStamp after the synchronization phase on DatePatternConverter

> 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

        

[jira] Commented: (LOG4NET-84) Allow messages to be printed in ascendant order according to date time.

Posted by "Nicko Cadell (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] Commented: (LOG4NET-84) Allow messages to be printed in ascendant order according to date time.

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-84?page=comments#action_12423990 ] 
            
Ron Grabowski commented on LOG4NET-84:
--------------------------------------

You solved your problem...do you still think this is an issue for log4net in general? I don't understand how log4net is suppose to synchronize messages so they get written in the correct time order. What if I'm trying to test out a new threading algorithm and I want messages to be written in the order in which they were processed by the application or something I don't have control over (i.e. the operating system)?

> 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