Thank you for your answer Dominik, but I have tried and it does not work :(! Apparently my appender is not added because it is not found... Maybe a reference is missing?
Dominik Psenner wrote: > > You'll have to specify the assembly where it is contained. Usually this is > the project name, but if you take a look at your AssemblyInfo.cs you'll > find > something like: > > [assembly: AssemblyTitle("your.name.goes.here")] > > Finally add that to the log4net configuration: > > type="Alfaplan.Carola.Prototype.Logging.CustomeAppender;assembly= > your.name.goes.here" > > At this point you're probably fine. > > All information comes shipped without warranty, but if it works don't > forget > to share your knowledge with others who need it. :-) > > Greetings, > D. > >> -----Original Message----- >> From: Nadesh [mailto:nadeshik...@hotmail.com] >> Sent: Friday, May 14, 2010 2:08 PM >> To: log4net-dev@logging.apache.org >> Subject: RE: My custome appender does not work >> >> >> 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:nadeshik...@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. > > > > -- View this message in context: http://old.nabble.com/My-custome-appender-does-not-work-tp28557313p28559150.html Sent from the Log4net - Dev mailing list archive at Nabble.com.