Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 7185 invoked from network); 9 Dec 2010 19:40:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Dec 2010 19:40:27 -0000 Received: (qmail 68703 invoked by uid 500); 9 Dec 2010 19:40:27 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 68628 invoked by uid 500); 9 Dec 2010 19:40:27 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 68620 invoked by uid 99); 9 Dec 2010 19:40:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 19:40:27 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of martin.fetzel@gmx.net designates 213.165.64.22 as permitted sender) Received: from [213.165.64.22] (HELO mail.gmx.net) (213.165.64.22) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 09 Dec 2010 19:40:19 +0000 Received: (qmail invoked by alias); 09 Dec 2010 19:39:57 -0000 Received: from chello084114166205.1.15.tuwien.teleweb.at (EHLO [192.168.1.5]) [84.114.166.205] by mail.gmx.net (mp008) with SMTP; 09 Dec 2010 20:39:57 +0100 X-Authenticated: #27836005 X-Provags-ID: V01U2FsdGVkX19cHa8FkAdcLcVpmMqU6/U3QsoCojNvWAjvRSkuk3 wPcXTmf5Nv6s5T Subject: Re: log4net serializable? From: Martin Fetzel To: Log4NET User In-Reply-To: References: <1291914973.2970.11.camel@FEC-A120D19MA> <1291915898.2970.14.camel@FEC-A120D19MA> Content-Type: text/plain; charset="UTF-8" Date: Thu, 09 Dec 2010 20:39:55 +0100 Message-ID: <1291923595.2970.17.camel@FEC-A120D19MA> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 (2.30.3-1.fc13) Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 Yes it seems that i have to serialize the logger itself. The problem is that the new pluginmanager is using appdomains and the Ilog object should be serializeable. When in the Appdomain an instance of the plugin will be created an exception will be thrown. protected virtual IPLUGIN InstantiatePlugin(String pPluginType, ILog pLog) { //created _appDom for plugin _Instance = this._appDom.CreateInstanceFromAndUnwrap(_AssemblyPath, pPluginType) as IPLUGIN; //set logger _Instance.Logger = pLog; <- this will throw the following exception: 'log4net.Core.LogImpl' in Assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' is not marked as serializable. This is why im searching for an serializeable ILog object. greetings On Thu, 2010-12-09 at 11:59 -0600, Ross Hinkley wrote: > Do you have to serialize the logger itself? Why not ignore it with > the XmlIgnore attribute? > > -Ross > > On Thu, Dec 9, 2010 at 11:31 AM, Martin Fetzel > wrote: > Hello, > > im sry, that im reposting this, but i forgot to post the > correct > typ /code which im using. > > ILog _log = LogManager.GetLogger(typeof(FileSyncService)); > > Interface of Plugin: void SyncDir(ILog pLog, string[] args); > > So the Object which returns LogManager.GetLogger should be > serializable. > Any one got an idea how i can fix this? > > greetings > > > > On Thu, 2010-12-09 at 18:16 +0100, Martin Fetzel wrote: > > Hello, > > > > we rewrote our pluginmanager and now the plugins have to be > > serializable. > > > > The plugins should also be able to log. So the interface of > the plugins > > looks something like that. Public void run(args[], log4net > plogger). > > > > But now (with the new pluginmanager) this isn’t working > because log4net > > isn’t serializable. > > > > How can i make log4net serializable? Have any one a good > solution for my > > problem? > > > > Greetings > > > > > > > > martin > > > > > >