[ 
https://issues.apache.org/jira/browse/LOG4NET-630?focusedWorklogId=250066&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-250066
 ]

ASF GitHub Bot logged work on LOG4NET-630:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/May/19 12:22
            Start Date: 29/May/19 12:22
    Worklog Time Spent: 10m 
      Work Description: 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. I use the new `LogLog` feature now like 
this:
   `<add key="log4net.Internal.LogMsgPatternString" value="%date 
[%7processid][%3thread][%appdomain] %level%logger %message%newline"/>`
   with an output like this:
   `2019-05-29 11:29:35,871 [  10636][  
7][/LM/W3SVC/1/ROOT/swimptest-TEST/sw-b-ch-dn-4-132035957756860640] log4net:  
log4net.Core.DefaultRepositorySelector defaultRepositoryType 
[log4net.Repository.Hierarchy.Hierarchy]`
   
   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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 250066)
    Time Spent: 1h 10m  (was: 1h)

> Log4Net missing Timestamp etc. in internal LogLog
> -------------------------------------------------
>
>                 Key: LOG4NET-630
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-630
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0.8
>            Reporter: Miro Jablonsky
>            Priority: Minor
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> I am facing the same problem as described in following StackOverflow topic: 
> [Log4Net internal debug 
> Timestamp|https://stackoverflow.com/questions/40077917/log4net-internal-debug-timestamp]
>  
> Citation:
> I am having intermittent problems with Log4net not logging and in other 
> threads there is a suggestion to setup internal logging by
> <add key="{color:#d04437}log4net.Internal.Debug{color}" 
> value="{color:#d04437}true{color}"/>
> I have added this and it does work, which is great, but there is no 
> timestamp. Is there a way I can have Timestamp on the internal logging. Any 
> help is appreciated.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to