logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Hinkley <rosshink...@gmail.com>
Subject Re: log4net serializable?
Date Thu, 09 Dec 2010 20:26:13 GMT
Could you pass the name of the configuration file or logger and configure
the logger when that instantiate method is called (or something similar)?

-Ross

On Thu, Dec 9, 2010 at 1:39 PM, Martin Fetzel <martin.fetzel@gmx.net> wrote:

> 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 <martin.fetzel@gmx.net>
> > 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
> >         >
> >
> >
> >
> >
>
>
>

Mime
View raw message