logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Psenner (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (LOG4NET-559) Custom Appender throws exception to user when I use %type in ConversionPattern
Date Wed, 15 Mar 2017 07:36:41 GMT

     [ https://issues.apache.org/jira/browse/LOG4NET-559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dominik Psenner reassigned LOG4NET-559:
---------------------------------------

    Assignee: Dominik Psenner

> Custom Appender throws exception to user when I use %type in ConversionPattern
> ------------------------------------------------------------------------------
>
>                 Key: LOG4NET-559
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-559
>             Project: Log4net
>          Issue Type: Bug
>    Affects Versions: 2.0.7
>            Reporter: Denis Abramov
>            Assignee: Dominik Psenner
>            Priority: Blocker
>
> When I setup my custom appender, I use the following ConversionPattern:
>   <layout type="log4net.Layout.PatternLayout">
>         <param name="ConversionPattern" value="%m%n&#13;&#10;%type" />
>    </layout>
> In my custom appender's "Append()" method, the "RenderLoggingEvent" is throwing the exception
below
> Here's how I am calling the RenderLoggingEvent method:
>  protected override void Append(LoggingEvent loggingEvent) {
>        ...       
>                 var text = RenderLoggingEvent(loggingEvent);
>        ...
>  }
>        
> Here is the exception I am getting:
> System.NullReferenceException was unhandled by user code
>   HResult=-2147467261
>   Message=Object reference not set to an instance of an object.
>   Source=log4net
>   StackTrace:
>        at log4net.Layout.Pattern.TypeNamePatternConverter.GetFullyQualifiedName(LoggingEvent
loggingEvent) in c:\log4net\tags\2.0.7RC1\src\Layout\Pattern\TypeNamePatternConverter.cs:line
51
>        at log4net.Layout.Pattern.NamedPatternConverter.Convert(TextWriter writer, LoggingEvent
loggingEvent) in c:\log4net\tags\2.0.7RC1\src\Layout\Pattern\NamedPatternConverter.cs:line
125
>        at log4net.Util.PatternConverter.Format(TextWriter writer, Object state) in c:\log4net\tags\2.0.7RC1\src\Util\PatternConverter.cs:line
173
>        at log4net.Layout.PatternLayout.Format(TextWriter writer, LoggingEvent loggingEvent)
in c:\log4net\tags\2.0.7RC1\src\Layout\PatternLayout.cs:line 1117
>        at log4net.Appender.AppenderSkeleton.RenderLoggingEvent(LoggingEvent loggingEvent)
in c:\log4net\tags\2.0.7RC1\src\Appender\AppenderSkeleton.cs:line 705
>        at MyAppender.MyAppender.Append(LoggingEvent loggingEvent) in E:\svn\trunk\MyAppender\MyAppender.cs:line
67
>        at log4net.Appender.AppenderSkeleton.DoAppend(LoggingEvent loggingEvent) in c:\log4net\tags\2.0.7RC1\src\Appender\AppenderSkeleton.cs:line
317
>   InnerException: 



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

Mime
View raw message