Question

Is there a way to use more than one ADONetAppender in the same application. Currently I have one ado appender logging to the "Log" table. I would like to add another ADONetAppender to log to another table in the same application. Searching the google did not return much help.

Please let me know.

thanks

Was it helpful?

Solution

Yes, in my Blog post here: http://weblogs.asp.net/stevewellens/archive/2012/01/22/log4net-log-to-a-javascript-console.aspx I use three appenders.

Here is where they get listed:

<logger name="MyLogger">
  <level value="ALL" />
  <appender-ref ref="LogFileAppender"  />
  <appender-ref ref="TraceAppender"  />
  <appender-ref ref="JSConsoleAppender"  />
</logger>

There's more but I'm not going to duplicate the whole post here.

OTHER TIPS

Below is the code to use multiple ADO Appender Just copy your ado appender and paste it again in your config file with below changes:

<appender name="CustomAppender" type="log4net.Appender.ADONetAppender">

Name of the appender should be different for Both the appender.

Then add into root tag

<root>
  <appender-ref ref="ADONetAppender"/>
  <appender-ref ref="CustomAppender"/>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top