logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nadesh <nadeshik...@hotmail.com>
Subject RE: My custome appender does not work
Date Fri, 14 May 2010 12:07:36 GMT

Hi!

I have tried to instantiate the appender by code and it works this way!
Thanks a lot :)! But do you have any idea why it does not work when I
instantiate it in the xml file?

Bye


Dominik Psenner wrote:
> 
> Hi.
> 
> May you wanna try to instantiate the appender by code to see if the
> configuration is not used / wrong? I suspect that it can't find and
> instantiate your class by
> type="Alfaplan.Carola.Prototype.Logging.CustomeAppender".
> 
> Greetings,
> d.
> 
>> -----Original Message-----
>> From: Nadesh [mailto:nadeshiko56@hotmail.com]
>> Sent: Friday, May 14, 2010 11:49 AM
>> To: log4net-dev@logging.apache.org
>> Subject: My custome appender does not work
>> 
>> 
>> Hello everyone!
>> 
>> I have created a new custome appender which shows a box message:
>> 
>> namespace Alfaplan.Carola.Prototype.Logging
>> {
>>     class CustomeAppender : log4net.Appender.AppenderSkeleton
>>     {
>> 
>>         protected override void Append(log4net.Core.LoggingEvent
>> loggingEvent)
>>         {
>>             MessageBox.Show("Message Sent: " +
>> loggingEvent.RenderedMessage);
>>         }
>>     }
>> }
>> 
>> And an xml file which is used to launch the appender:
>> 
>> <?xml version="1.0" encoding="utf-8" ?>
>>   <log4net>
>>     <appender name="CustomeAppender"
>> type="Alfaplan.Carola.Prototype.Logging.CustomeAppender">
>>       <threshold value="INFO"/>
>>       <layout type="log4net.Layout.PatternLayout">
>> 
>> 
>> 
>>       </layout>
>>     </appender>
>> 
>>     <root>
>>       <level value="DEBUG" />
>>       <appender-ref ref="CustomeAppender" />
>>     </root>
>>   </log4net>
>> 
>> When I use a classic FileAppender on my project everything work, but with
>> my
>> new appender I have nothing (I have changed the AssemblyInfo.cs file to
>> use
>> my new xml file). Can someone help me?
>> 
>> Thanks :)
>> --
>> View this message in context: http://old.nabble.com/My-custome-appender-
>> does-not-work-tp28557313p28557313.html
>> Sent from the Log4net - Dev mailing list archive at Nabble.com.
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/My-custome-appender-does-not-work-tp28557313p28558556.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.


Mime
View raw message