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

Dominik Psenner commented on LOG4NET-553:
-----------------------------------------

I have a mixed feeling about the requirement to make the 
LayoutSkeleton.Format(loggingEvent) method virtual and the need of a 
ReturnsNullLayout class. From a semantical point of view, category := null is 
equivalent to category := string.Empty. Should the DebugAppender detect empty 
categories and invoke Debug.Write(message) [2] in that case? Not having null 
values would make the patch way more trivial, what do you think?

I'm not so familiar with Debug.Write(message, category) [1]. If category is 
expected to be null (or empty), is the invocation of Debug.Write(message) [2] 
to be preferred? According to the documentation, it will invoke 
TraceListener.Write(message, category) [3] which mentions no limitations to the 
allowed argument values.

References:
[1] https://msdn.microsoft.com/en-us/library/a1z6t089(v=vs.110).aspx
[2] https://msdn.microsoft.com/en-us/library/54ffa64k(v=vs.110).aspx
[3] https://msdn.microsoft.com/en-us/library/sawdbchb(v=vs.110).aspx

> DebugAppender configuration should give the possibility to disable outputting 
> loggerName as category
> ----------------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-553
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-553
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Appenders
>    Affects Versions: 2.0.7
>            Reporter: Jean-Francois Beaulac
>         Attachments: log4net-DebugAppenderCategory2.patch, 
> log4net-DebugAppenderCategory.patch, 
> OutputCategoryParam-DebugAppender.cs.patch
>
>
> The DebugAppender always uses the 
> {{System.Diagnostics.Debug.Write(string,string)}} overload passing in the 
> loggername as the category parameter.
> It should be possible to omit the category parameter if having the loggername 
> as category is not desired.
> Attached is a patch implementing the desired new feature, which would be 
> activated by configuration:
> {code:xml}
> <appender name="DEBUG" type="log4net.Appender.DebugAppender">
>     <outputCategory value="false"/>
>     <layout type="log4net.Layout.PatternLayout">
>         <conversionPattern value="%-5level: %message%newline"/>
>     </layout>
>   </appender>
> {code}
> In my patch, the outputCategory parameter defaults to true, so the behavior 
> doesnt change unless the new configuration is used.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to