mirec75 commented on issue #49: Fixes LOG4NET-630 Log4Net missing Timestamp 
etc. in internal LogLog
URL: https://github.com/apache/logging-log4net/pull/49#issuecomment-496911894
 
 
   Phew! Because of the %message, etc., I had a deeper look under the log4net 
hood, how the `PatternLayout` cooperates with `LoggingEvent`, and how and why 
similar thing is not available in `PatternString`.
   
   Well, I did it. And it is (hopefully) generic. I added the generic methods 
`Format(TextWriter writer, object state) `and `FormatWithState(object state)` 
in `PatternString` and redirected the original methods `Format(TextWriter 
writer)` and `Format()` to it respectively. This feature opens others the 
possibility to implement and use custom converters, which can handle the 
`object state` parameter.
   Then I added 3 `LogLog` specific simple Pattern Converters converting 
%message (filled from `LogLog.Message`), %logger (filled from `LogLog.Source`) 
and %level (filled from `LogLog.Prefix`).
   I updated the `LogLog` internals to cooperate with this. There is a specific 
factory method `public static PatternString CreateForLogLog(string pattern)` in 
`PatternString` simplifying creation of the `LogLog` specific `PatternString`.
   
   I added UnitTests and tested it also in integration tests with my .Net Web 
Services. All I tested is working fine.
   
   Because of this "bigger" change, I did not dare to add it to the LOG4NET-630 
pull request directly and parked it in a subbranch of LOG4NET-630, named: 
[LogLogPatternString](https://github.com/mirec75/logging-log4net/tree/feature/LogLogPatternString).
 Please have a look at the branch here and let me know, what to do with it 
(e.g. merge to this LOG4NET-630 pull request, or whatever to do):
   https://github.com/mirec75/logging-log4net/tree/feature/LogLogPatternString
   
   > Given your substantial contribution, I see it necessary that you sign an 
individual contributor license agreement. It does grant the Apache Software 
Foundation sufficient rights to release any work you submit under the Apache 
license.
   
   I'll read and sign the contributor license in the next days and let you 
know, but I was first eager to code the solution :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to