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

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

Hi!

Thanks for the patch. While I can see the usecase for the feature, a more 
generic approach is in my opinion to be preferred. For instance, a second 
layout (i.e. CategoryLayout) property could be introduced in the DebugAppender 
that is then used to format the category parameter. Once that API is 
introduced, your usecase can then be implemented by specifying a 
SecondaryLayout that always returns null. Further, the default CategoryLayout 
would return the LoggerName in order to preserve the current behavior. What do 
you think?

Cheers

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