Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: GAC vs. XmlHierarchyConfigurator Problem
Prev Next
You are not authorized to post a reply.

Author Messages
CLaco@SummitRacing.com

09/10/2008 6:44 PM  

I've found a few posts on Google about this issue, but none seem to be the exact problem I'm having.
When I started adding log4net to some of my projects, I just added a reference to the dll, which was then copied to the output directory.

I added this following code to my AssemblyInfo file, setup the app.config and everything worked like a champ.

  <Assembly: log4net.Config.XmlConfigurator(Watch:=True)>

I then installed log4net into the GAC on the servers and then on my machine and removed all copies from bin. Everything compiles, and even runs fine, but nothing is logged.

After turning on log4net internal debug logging,. I see the text below in the log4net trace.

Clearly, It's loading log4net from the GAC to start with, but then stalls out during the XmlHierarchyConfigurator part of the process.

Any ideas?

Of course, if I place a copy in bin, it works; thus defeating the purpose of installing it into the GAC.

-=Chris

---
log4net: log4net assembly [log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821]. Loaded from [Global Assembly Cache]. (.NET Runtime ΐ.0.50727.3053] on Microsoft Windows NT 5.1.2600 Service Pack 2)

log4net: DefaultRepositorySelector: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: DefaultRepositorySelector: Creating repository for assembly [SRE.Services.OrderImportService, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c5b9e92786b57ef1]

log4net: DefaultRepositorySelector: Assembly [SRE.Services.OrderImportService, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c5b9e92786b57ef1] Loaded From [C:\Development\OrderImportService\bin\Debug\SRE.Services.OrderImportService.exe]

log4net: DefaultRepositorySelector: Assembly [SRE.Services.OrderImportService, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c5b9e92786b57ef1] does not have a RepositoryAttribute specified.

log4net: DefaultRepositorySelector: Assembly [SRE.Services.OrderImportService, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c5b9e92786b57ef1] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]

log4net: DefaultRepositorySelector: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]

log4net: XmlConfigurator: configuring repository [log4net-default-repository] using file [C:\Development\OrderImportService\bin\Debug\SRE.Services.OrderImportService.exe.config] watching for file updates

log4net: XmlConfigurator: configuring repository [log4net-default-repository] using file [C:\Development\OrderImportService\bin\Debug\SRE.Services.OrderImportService.exe.config]

log4net: XmlConfigurator: configuring repository [log4net-default-repository] using stream
log4net: XmlConfigurator: loading XML configuration
log4net: XmlConfigurator: Configuring Repository [log4net-default-repository]
log4net: XmlHierarchyConfigurator: Configuration update mode [Merge].
log4net: XmlHierarchyConfigurator: Logger [root] Level string is [ALL].
log4net: XmlHierarchyConfigurator: Logger [root] level set to [name="ALL",value=-2147483648].
log4net: XmlHierarchyConfigurator: Loading Appender [LogFileAppender] type: [log4net.Appender.RollingFileAppender,log4net]

log4net:ERROR XmlHierarchyConfigurator: Could not create Appender [LogFileAppender] of type [log4net.Appender.RollingFileAppender,log4net]. Reported error follows.

System.IO.FileNotFoundException: Could not load file or assembly 'log4net' or one of its dependencies. The system cannot find the file specified.

File name: 'log4net'
   at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)

   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)

   at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)

   at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at log4net.Util.SystemInfo.GetTypeFromString(Assembly relativeAssembly, String typeName, Boolean throwOnError, Boolean ignoreCase)

   at log4net.Util.SystemInfo.GetTypeFromString(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement appenderElement)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

log4net:ERROR XmlHierarchyConfigurator: Appender named [LogFileAppender] not found.


CLaco@SummitRacing.com

09/10/2008 6:57 PM  
This would be because I'm an idiot. :-)
I have the type in configSection set to the full GAC version/pubkey, but I didn't have the full type set when defining appenders. Bigh duh.
 
-=Chris
You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > GAC vs. XmlHierarchyConfigurator Problem



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement