You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Dominik Psenner (JIRA)" <ji...@apache.org> on 2013/08/07 14:32:50 UTC

[jira] [Closed] (LOG4NET-277) Registering a custom Object Renderer in configuration file

     [ https://issues.apache.org/jira/browse/LOG4NET-277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominik Psenner closed LOG4NET-277.
-----------------------------------

       Resolution: Not A Problem
    Fix Version/s:     (was: 1.2 Maintenance Release)
                   1.2.12
         Assignee: Dominik Psenner

As pointed out in a previous comment: when one references a class from another assembly, one has to specify the assembly where it is located.
                
> Registering a custom Object Renderer in configuration file
> ----------------------------------------------------------
>
>                 Key: LOG4NET-277
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-277
>             Project: Log4net
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 1.2.10
>         Environment: Windows .Net WebService
>            Reporter: Daniel Shoubridge
>            Assignee: Dominik Psenner
>             Fix For: 1.2.12
>
>
> When you include the line:
>      <renderer renderingClass="RootNameSpace.Namespace.RendererClass" renderedClass="RootNameSpace.NameSpace.ClassToRender" />
> in the configuration file and call:
>      log4net.Config.XmlConfigurator.ConfigureAndWatch(New IO.FileInfo(logfile))
> in global.asax, you get a TypeLoadException. Log4Net internal debugging outputs the following:
> log4net:ERROR OptionConverter: Could not instantiate class [LogLibrary.Log4NetObjRenderers.PdaLogObjRenderer].
> System.TypeLoadException: Could not load type [LogLibrary.Log4NetObjRenderers.PdaLogObjRenderer]. Tried assembly [log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821] and all loaded assemblies
>    at log4net.Util.SystemInfo.GetTypeFromString(Assembly relativeAssembly, String typeName, Boolean throwOnError, Boolean ignoreCase) in c:\work\svn_root\apache\log4net\tags\log4net-1.2.10-rc2\build\package\log4net-1.2.10\src\Util\SystemInfo.cs:line 671
>    at log4net.Util.SystemInfo.GetTypeFromString(String typeName, Boolean throwOnError, Boolean ignoreCase) in c:\work\svn_root\apache\log4net\tags\log4net-1.2.10-rc2\build\package\log4net-1.2.10\src\Util\SystemInfo.cs:line 602
>    at log4net.Util.OptionConverter.InstantiateByClassName(String className, Type superClass, Object defaultValue) in c:\work\svn_root\apache\log4net\tags\log4net-1.2.10-rc2\build\package\log4net-1.2.10\src\Util\OptionConverter.cs:line 477
> log4net:ERROR XmlHierarchyConfigurator: Could not instantiate renderer [LogLibrary.Log4NetObjRenderers.PdaLogObjRenderer].
> Work Around:
> 1, If you then stop the web server 
> 2, and comment out the <renderer line in the configuration file, 
> 3, start the web service again, 
> 4, then after it has started (global.asax has been processed) 
> 5, uncomment the <renderer line
> 6, the renderer will now work

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira