[ 
http://issues.apache.org/jira/browse/LOG4NET-106?page=comments#action_12458062 
] 
            
Chi Lang commented on LOG4NET-106:
----------------------------------

I just want the simplest solutions that works so I would wait with
generalization until we'll actually see another user request with
TraceAppender.

I like your config change

<appender name="TraceAppender" type="log4net.Appender.TraceAppender">
<category type="log4net.Appender.TraceAppender+NullCategory" />
 <layout type="log4net.Layout.SimplePatternLayout" />
</appender>

but would rather still add an property to TraceAppender rather than extends
it.



> TraceAppender : Add switch to disable using logger name as trace category
> -------------------------------------------------------------------------
>
>                 Key: LOG4NET-106
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-106
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 1.2.9
>            Reporter: Chi Lang
>            Priority: Trivial
>
> TraceAppender now always put logger name as trace category when writing to 
> System.Diagnostics.Trace.Write
> ie. :
> System.Diagnostics.Trace.Write(RenderLoggingEvent(loggingEvent), 
> loggingEvent.LoggerName);
> This resulted in logger's name appearing twice in Trace logs if once 
> use/share the same conversion for both file-based and trace appenders, eg.
> "%date [%thread] %-5level %logger - %message%"
> It would be nice to have a settable property on TraceAppender to disable 
> using logger's name as trace category, ie. :
> public bool UseLoggerNameAsTraceCategory
> {
> get; set;
> }
> ...
> if (m_useLoggerNameAsTraceCategory)
> {
>   System.Diagnostics.Trace.Write(RenderLoggingEvent(loggingEvent), 
> loggingEvent.LoggerName);
> }
> else
> {
>   System.Diagnostics.Trace.Write(RenderLoggingEvent(loggingEvent), null);
> }

-- 
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