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

Remko Popma edited comment on LOG4J2-1074 at 7/13/15 1:25 PM:
--------------------------------------------------------------

Gary, the main hot path (creating log events from DefaultLogEventFactory) will 
still use a constructor.
Pretty much all JUnit tests will use the builder. Pretty much the only thing 
that is affected by the builder idea is the JUnit tests. One exception is that 
I've also changed the *RewritePolicy implementations to use the builder because 
the resulting code is much cleaner and easier to understand.

I will see if I can do a commit with just these changes omitting the nanoTime 
field.

UPDATE: commit 14e27b4b has the following changes:
{quote}
prepare for LOG4J2-1074: 
- strengthen Log4jLogEvent.Builder to contain all attributes
- add copy constructor to Log4jLogEvent.Builder
- migrate all JUnit tests to construct LogEvents via
Log4jLogEvent.Builder
- migrate *RewritePolicy implemenations to construct LogEvents via
Log4jLogEvent.Builder (copy constructor & modify desired attribute)
- deprecate Log4jLogEvent constructors and factory method that no longer
have any references to them
{quote}



was (Author: [email protected]):
Gary, the main hot path (creating log events from DefaultLogEventFactory) will 
still use a constructor.
Pretty much all JUnit tests will use the builder. Pretty much the only thing 
that is affected by the builder idea is the JUnit tests. One exception is that 
I've also changed the *RewritePolicy implementations to use the builder because 
the resulting code is much cleaner and easier to understand.

I will see if I can do a commit with just these changes omitting the nanoTime 
field.

> Add a logformat token for nanotime
> ----------------------------------
>
>                 Key: LOG4J2-1074
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1074
>             Project: Log4j 2
>          Issue Type: New Feature
>            Reporter: Will Hains
>            Assignee: Remko Popma
>
> Add a token in the log format specifier to output the current value of 
> {{System.nanotime()}}.
> We are currently adding the nanotime value to our log messages manually, 
> which we find very useful for troubleshooting unexpected latency, and as a 
> quick-and-dirty data source to feed into performance analysis tools.
> It would be very nice if Log4j could do this for us. It would also be nice to 
> have this in the log format specified, so we can turn it on/off at runtime by 
> editing the Log4j config file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to