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 |
|
Graham Walsh
 |
| 09/18/2008 3:50 PM |
|
Hi,
I have an issue with a GUI app I'm running. I make calls across dll's as expected and my logging works fine. I have a richTextappender in place thats used by the GUI. As logging is done I see it in the richText box of my gui. We'll call this "normal" execution.
Now as part of our testing, I create an appDomain and make the method calls just as does the "normal" execution. I want this new appdomain to log to the same richTextBox however its not. In an attempt to take another approach, I tried to get the ILog object from the "Normal" execution and set it in the newly created AppDomain. This cant be done as;
- System.Runtime.Serialization.SerializationException: Type 'log4net.Core.LogImpl' in Assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' is not marked as serializable.
So I'm stuck. Anybody know how I can work around this issue?
thanks much
Graham
|
|
|
|
|
Nick Durcholz
 |
|
Peter Drier
 |
| 09/20/2008 7:57 PM |
|
We're using log4net in an multi app domain application.. Lets say it was tricky.. Not sure if this would solve your problem, but this is what we did:
1. In the root app domain, we setup log4net as normal.. And added a custom Plugin that we wrote to the l4n interface that was accessible to our child domains.
1.. In each child app domain, we setup l4n with a single custom appender that knew how to find the plugin from #1 and forward all events to it, after a few checks to ensure that exceptions were serializable.
So now anything logged in the child domain was sent to the parent, to follow the config rules and get logged out as necessary.
Cheers,
Peter
|
|
|
|
|
Ron Grabowski
 |
| 09/21/2008 7:51 PM |
|
My first thought would be to use .NET Remoting with named pipes. Did you try that?
|
|
|
|
|
Peter Drier
 |
| 09/21/2008 11:27 PM |
|
Remoting to another process would have incurred a level of overhead we weren't willing to take for the logging portion of the application.. named pipes would have saved a bunch of the overhead, but I'm pretty sure the app domain crossing setup we came up with is about as optimal as we can get under the multi app domain setup we have..
-Peter
|
|
|
|
|
|
| You are not authorized to post a reply. |
|
|
|
ActiveForums 3.7
|