[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4net-user
Subject:    Re: logger and app domains
From:       "Peter Drier" <peter.drier () gmail ! com>
Date:       2008-09-21 21:27:45
Message-ID: aabdb3970809211427x6be55d2frfee9f0a108f509a4 () mail ! gmail ! com
[Download RAW message or body]

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

--
Peter's Photography
www.PeterDrier.com


On Sun, Sep 21, 2008 at 1:51 PM, Ron Grabowski <rongrabowski@yahoo.com>wrote:

> My first thought would be to use .NET Remoting with named pipes. Did you
> try that?
>
> ----- Original Message ----
> From: Peter Drier <peter.drier@gmail.com>
> To: Log4NET User <log4net-user@logging.apache.org>
> Sent: Saturday, September 20, 2008 1:57:11 PM
> Subject: Re: logger and app domains
>
> 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
>
> --
> Peter's Photography
> www.PeterDrier.com
>
>
> 2008/9/18 Graham Walsh <graham.walsh-prestataire@calyon.com>
>
>>  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
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Ce message et ses pièces jointes (le "message") est destiné à l'usage
>> exclusif de son destinataire.
>> Si vous recevez ce message par erreur, merci d'en aviser immédiatement
>> l'expéditeur  et de le détruire ensuite. Le présent message  pouvant
>> être altéré à notre insu,  CALYON Crédit Agricole CIB
>> ne peut pas être engagé par son contenu. Tous droits réservés.
>>
>> This message and/or any  attachments (the "message") is intended for
>> the sole use of its addressee.
>> If you are not the addressee, please immediately notify the sender and
>> then destroy the message.  As this message and/or any attachments may
>> have been altered without our knowledge,  its content  is not legally
>> binding on CALYON Crédit Agricole CIB. All rights reserved.
>>
>>
>

[Attachment #3 (text/html)]

<div dir="ltr">Remoting to another process would have incurred a level of overhead we \
weren&#39;t willing to take for the logging portion of the application.. &nbsp;named \
pipes would have saved a bunch of the overhead, but I&#39;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..<div> <br></div><div>-Peter</div><div><br \
clear="all">--<br>Peter&#39;s Photography<br><a \
href="http://www.PeterDrier.com">www.PeterDrier.com</a><br> <br><br><div \
class="gmail_quote">On Sun, Sep 21, 2008 at 1:51 PM, Ron Grabowski <span \
dir="ltr">&lt;<a href="mailto:rongrabowski@yahoo.com">rongrabowski@yahoo.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> <div><div style="font-family:times new roman, new \
york, times, serif;font-size:12pt"><div>My first thought would be to use .NET \
Remoting with named pipes. Did you try that?<br></div><div><div></div><div \
class="Wj3C7c"><div style="font-family:times new roman,new \
york,times,serif;font-size:12pt"> <br><div style="font-family:times new roman,new \
york,times,serif;font-size:12pt">----- Original Message ----<br>From: Peter Drier \
&lt;<a href="mailto:peter.drier@gmail.com" \
                target="_blank">peter.drier@gmail.com</a>&gt;<br>
To: Log4NET User &lt;<a href="mailto:log4net-user@logging.apache.org" \
target="_blank">log4net-user@logging.apache.org</a>&gt;<br>Sent: Saturday, September \
20, 2008 1:57:11 PM<br>Subject: Re: logger and app domains<br><br> <div \
dir="ltr">We&#39;re using log4net in an multi app domain application.. &nbsp;Lets say \
it was tricky.. &nbsp; Not sure if this would solve your problem, but this is what we \
did:<div><br></div><div>1. &nbsp;In the root app domain, we setup log4net as normal.. \
&nbsp;And added a custom Plugin that we wrote to  the l4n interface that was \
accessible to our child domains.</div> <div>1.. &nbsp;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. &nbsp;</div>

<div><br></div><div>So now anything logged in the child domain was sent to the \
parent, to follow the config rules and get logged out as necessary. \
&nbsp;</div><div><br></div><div>Cheers,</div><div>Peter</div><div><br clear="all">

--<br>Peter&#39;s Photography<br><a rel="nofollow" href="http://www.PeterDrier.com" \
target="_blank">www.PeterDrier.com</a><br> <br><br><div class="gmail_quote">2008/9/18 \
Graham Walsh <span dir="ltr">&lt;<a rel="nofollow" \
href="mailto:graham.walsh-prestataire@calyon.com" \
target="_blank">graham.walsh-prestataire@calyon.com</a>&gt;</span><br><blockquote \
class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt \
0pt 0.8ex;padding-left:1ex">





<div>
<div><span><font size="2" face="Arial">Hi,</font></span></div>
<div><span><font size="2" face="Arial"></font></span>&nbsp;</div>
<div><span><font size="2" face="Arial">I have an issue with 
a GUI app I&#39;m running. I make calls across dll&#39;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&#39;ll call this \
&quot;normal&quot;  execution.</font></span></div>
<div><span><font size="2" face="Arial"></font></span>&nbsp;</div>
<div><span><font size="2" face="Arial">Now as part of our 
testing, I create an appDomain and make the method calls just as does the 
&quot;normal&quot; execution.&nbsp;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 &quot;Normal&quot; execution and set it in the newly \
created  AppDomain. This cant be done as;</font></span></div>
<div><span><font size="2" face="Arial"></font></span>&nbsp;</div>
<div><span><font size="2" face="Arial"></font></span>&nbsp;</div>
<div><span><font color="#ff0000">
<p></p></font><font size="1">- </font><font \
size="2">System.Runtime.Serialization.SerializationException:<font face="Microsoft \
Sans Serif"> Type &#39;log4net.Core.LogImpl&#39; in Assembly &#39;log4net,  \
Version=<a rel="nofollow" href="http://1.2.10.0" target="_blank">1.2.10.0</a>, \
Culture=neutral, PublicKeyToken=1b44e1d426115821&#39; is not  marked as \
serializable.</font></font> <p><font size="2" face="Microsoft Sans \
Serif"></font>&nbsp;</p> <p><span><font size="2" face="Microsoft Sans Serif">So 
I&#39;m stuck. Anybody know how I can work around this issue? </font></span></p>
<p><span><font size="2" face="Microsoft Sans Serif"></font></span>&nbsp;</p>
<p><span><font size="2" face="Microsoft Sans Serif">thanks much</font></span></p>
<p><span><font size="2" face="Microsoft Sans Serif"></font></span>&nbsp;</p>
<p><span><font size="2" face="Microsoft Sans Serif">Graham</font></span></p>
<p><span></span>&nbsp;</p>
<p><font size="2" face="Microsoft Sans Serif"></font>&nbsp;</p>
<p><font size="1" face="Microsoft Sans Serif"><font size="2" \
face="Arial"></font></font>&nbsp;</p> <p><font size="1" face="Microsoft Sans \
Serif"><font size="2" face="Arial"></font>&nbsp;</font></p></span></div></div> <br>Ce \
message et ses pièces jointes (le &quot;message&quot;) est destiné à l&#39;usage<br> \
exclusif de son destinataire.<br> Si vous recevez ce message par erreur, merci \
d&#39;en aviser immédiatement<br> l&#39;expéditeur &nbsp;et de le détruire ensuite. \
Le présent message &nbsp;pouvant<br> être altéré à notre insu, &nbsp;CALYON Crédit \
Agricole CIB<br> ne peut pas être engagé par son contenu. Tous droits réservés.<br>
<br>
This message and/or any &nbsp;attachments (the &quot;message&quot;) is intended \
for<br> the sole use of its addressee.<br>
If you are not the addressee, please immediately notify the sender and<br>
then destroy the message. &nbsp;As this message and/or any attachments may<br>
have been altered without our knowledge, &nbsp;its content &nbsp;is not legally<br>
binding on CALYON Crédit Agricole CIB. All rights reserved.<br>
<br></blockquote></div><br></div></div>
</div></div></div></div></div></div></blockquote></div><br></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic