logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave McEwan" <dmce...@harmonyis.com>
Subject RE: Trouble using XmlConfigurator assembly attribute
Date Mon, 10 Sep 2007 21:05:09 GMT
Just curious...if you put the full path in the assemblyInfo file like so
what happens:

 

[assembly: log4net.Config.XmlConfigurator(ConfigFile =
"C:\MyApp\bin\App.log4net", Watch = true)]

 

  _____  

From: Mark Modrall [mailto:MModrall@glgroup.com] 
Sent: Monday, September 10, 2007 5:01 PM
To: Log4NET User
Subject: RE: Trouble using XmlConfigurator assembly attribute

 

Yep...  I'm leaving the assembly attributes in and just adding the line
to Main().  If I have it done directly in Main() it gets the right
config; if I leave it to the assembly attributes, it doesn't.
Assemblies and configs all go to the same dir.  That's why I'm
scratching my head...

 

Thanks
Mark

 

 

 

This e-mail message, and any attachments, is intended only for the use
of the individual or entity identified in the alias address of this
message and may contain information that is confidential, privileged and
subject to legal restrictions and penalties regarding its unauthorized
disclosure and use. Any unauthorized review, copying, disclosure, use or
distribution is strictly prohibited. If you have received this e-mail
message in error, please notify the sender immediately by reply e-mail
and delete this message, and any attachments, from your system. Thank
you. 

  _____  

From: Dave McEwan [mailto:dmcewan@harmonyis.com] 
Sent: Monday, September 10, 2007 4:58 PM
To: Log4NET User
Subject: RE: Trouble using XmlConfigurator assembly attribute

 

Are you sure that your config file is in the "same" directory as the
executable?

 

 

  _____  

From: Mark Modrall [mailto:MModrall@glgroup.com] 
Sent: Monday, September 10, 2007 4:56 PM
To: log4net-user@logging.apache.org
Subject: Trouble using XmlConfigurator assembly attribute

 

Hi...

 

            I've got some programs/assemblies that I'm building and for
some reason, the XmlConfigurator assembly attribute isn't working.  A
couple of the assemblies have

 

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "App.log4net",
Watch = true)]

 

In their AssemblyInfo.cs files, but when I run the program

 

Log4Net.LogManager.GetLogger("foo");

 

Doesn't return the logger defined in the file.

 

            If I put

log4net.Config.XmlConfigurator.Configure(new
System.IO.FileInfo("App.log4net"));

 

into the app Main(), though, it does find the config, load it, and
return the right logger instance.

 

            Is there some trick to using the assembly attribute?

 

Thanks
Mark

 

 

This e-mail message, and any attachments, is intended only for the use
of the individual or entity identified in the alias address of this
message and may contain information that is confidential, privileged and
subject to legal restrictions and penalties regarding its unauthorized
disclosure and use. Any unauthorized review, copying, disclosure, use or
distribution is strictly prohibited. If you have received this e-mail
message in error, please notify the sender immediately by reply e-mail
and delete this message, and any attachments, from your system. Thank
you. 


Mime
View raw message