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.fet...@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
>         >
>         
>         
>         
> 


Reply via email to