The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.
| Author |
Messages |
|
omatase
 |
| 04/08/2009 12:17 AM |
|
I cannot figure this one out.
I have been tasked by my team to create a logging service so that we can all have convenient logging without having to integrate it into our individual projects. I decided to do this I would just build a wrapper around log4net that makes it even simpler to use than it already is.
After not too much work I got it up and running and (seemingly) working. I had it running on a development web server here for people to begin using with no issues initially.
Now I am getting this really really really crappy error whenever I try to write a log no matter the loglevel or the logger being used. I have narrowed it down to config file changes but cannot find an answer.
The changes I narrowed it down to are: If I have the following configuration in my log4net xml section everything is fine
<root> <level value="DEBUG" /> <appender-ref ref="AdoNetAppender" /> </root>
And if I add an additional logger suchas:
<logger name="Invoicing"> <level value="DEBUG" /> <appender-ref ref="AdoNetAppender" /> </logger>
we're still in good shape. But! When I add another logger with the same "name" as another existing logger suchas:
<logger name="Invoicing"> <level value="FATAL" /> <appender-ref ref="FileAppender" /> </logger>
all hell breaks loose and I get the following error:
"log4net:ERROR [] Attempted to append to closed appender named []"
I am certain log4net is supposed to support a log strategy such as this so that I can have fatal messages logged differently for the same logger name. Can someone help me understand what's going on?
I can post any and all code I have if it will help diagnose the problem.
Thanks |
|
|
|
|
Ron Grabowski
 |
| 04/08/2009 1:09 AM |
|
Does this work?
<logger name="Invoicing"> <level value="DEBUG" /> <appender-ref ref="AdoNetAppender" /> <appender-ref ref="FileAppender" /> </logger>
|
|
|
|
|
omatase
 |
| 04/08/2009 4:24 PM |
|
Ron Grabowski wrote: > > > Does this work? > > <logger name="Invoicing"> > <level value="DEBUG" /> > <appender-ref ref="AdoNetAppender" /> > <appender-ref ref="FileAppender" /> > </logger> > >
Yes there is no problem when I do that. That doesn't however allow me to have my FATAL messages logged differently than my DEBUG messages which is what I'm trying to accomplish.
|
|
|
|
|
|
| You are not authorized to post a reply. |
|
|
|
ActiveForums 3.7
|