You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "Burger, Erik" <Er...@Gpxs.net> on 2005/04/28 18:21:52 UTC

RE: EventLogAppender configured but logger thinks that logging is disabled

It is. The line Ron gave you goes into your AssemblyInfo.cs file (at least,
that's where I put it). Be sure to add using log4net.Config as well.

Erik

-------------------------------
Lead Developer
Research and Development Group
GPXS Wireless Ltd.
Southampton, United Kingdom
Phone: +44 (0) 23 8076 2519
Fax:   +44 (0) 23 8076 2555
Email: erik.burger@gpxs.net


-----Original Message-----
From: Micdev42(Yahoo) [mailto:micdev42@yahoo.co.uk] 
Sent: Thursday, April 28, 2005 5:22 PM
To: 'Log4NET User'
Subject: RE: EventLogAppender configured but logger thinks that logging is
disabled


Also, I have all my config in web.config, not a separate file. Is that OK? 

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: 28 April 2005 17:11
To: Log4NET User
Subject: Re: EventLogAppender configured but logger thinks that logging is
disabled

Have you told log4net to start logging?

[assembly: log4net.Config.DOMConfigurator(
ConfigFile="Log4Net.config",Watch=true )]

--- "Micdev42(Yahoo)" <mi...@yahoo.co.uk> wrote:
> Hello,
> I have an ASP.NET 1.1. application.
> Here is my code:
> 
> 	log4net.ILog log = log4net.LogManager.GetLogger("F2Logger");
> 	log.Info("Some meaningful message);
> 
> When I look at the log variable, Info is false (as are all the other 
> levels). I've got a project reference to the .NET 1.1 release 
> log4net.dll (1.2 beta8).
> 
> Here's highlights from my config file:
> 
>   <configSections>
> 	<section name="log4net" 
> type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
>   </configSections>
> 
> 	<log4net debug="true">
> 		<appender name="EventLogAppender" 
> type="log4net.Appender.EventLogAppender" >
> 			<param name="LogName" value="Application" />
> 			<param name="ApplicationName" value="F2" />
> 			<layout type="log4net.Layout.PatternLayout">
> 				<param name="ConversionPattern" value="%d
> [%t] %-5p %c [%x] - %m%n" />
> 			</layout>
> 		</appender>
> 
> 		<root>
> 			<level value="DEBUG" />
> 		</root>
> 
> 		<logger name="F2Logger">
> 			<level value="INFO" />
> 			<appender-ref ref="EventLogAppender" />
> 		</logger>
> 	</log4net>
> 
> 
> I've already 'initialised' the event log to permit an application name 
> of F2. In any case, my issue occurs before we try to write to the 
> event log.
> 
> What am I doing wrong? It all seems so simple...
> Hope you can help.
> 
> Regards
> Michael
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.10.4 - Release Date:
> 27/04/2005
>  
> 
> 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 27/04/2005
 

The information transmitted by this e-mail message is intended solely for
the use of the person to whom or entity to which it is addressed. The
message may contain information that is privileged and confidential.
Disclosure, dissemination, distribution, review, retransmission to, other
use of or taking any action in reliance upon this information by anyone
other than the intended recipient is prohibited. If you are not the intended
recipient, please do not disseminate, distribute or copy this communication,
by e-mail or otherwise. Instead, please notify us immediately by return
e-mail (including the original message with your reply) and then delete and
discard all copies of the message.

Although we have taken precautions to minimize the risk of transmitting
viruses we nevertheless advise you to carry out your own virus checks on any
attachment to this message. We accept no liability for any loss or damage
caused by viruses.

RE: EventLogAppender configured but logger thinks that logging is disabled

Posted by "Micdev42(Yahoo)" <mi...@yahoo.co.uk>.
Should it be this then:

[assembly: log4net.Config.DOMConfigurator(ConfigFile="web.config",Watch=true
)] 

???


-----Original Message-----
From: Burger, Erik [mailto:Erik.Burger@Gpxs.net] 
Sent: 28 April 2005 17:22
To: 'Log4NET User'
Subject: RE: EventLogAppender configured but logger thinks that logging is
disabled

It is. The line Ron gave you goes into your AssemblyInfo.cs file (at least,
that's where I put it). Be sure to add using log4net.Config as well.

Erik

-------------------------------
Lead Developer
Research and Development Group
GPXS Wireless Ltd.
Southampton, United Kingdom
Phone: +44 (0) 23 8076 2519
Fax:   +44 (0) 23 8076 2555
Email: erik.burger@gpxs.net


-----Original Message-----
From: Micdev42(Yahoo) [mailto:micdev42@yahoo.co.uk] 
Sent: Thursday, April 28, 2005 5:22 PM
To: 'Log4NET User'
Subject: RE: EventLogAppender configured but logger thinks that logging is
disabled


Also, I have all my config in web.config, not a separate file. Is that OK? 

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: 28 April 2005 17:11
To: Log4NET User
Subject: Re: EventLogAppender configured but logger thinks that logging is
disabled

Have you told log4net to start logging?

[assembly: log4net.Config.DOMConfigurator(
ConfigFile="Log4Net.config",Watch=true )]

--- "Micdev42(Yahoo)" <mi...@yahoo.co.uk> wrote:
> Hello,
> I have an ASP.NET 1.1. application.
> Here is my code:
> 
> 	log4net.ILog log = log4net.LogManager.GetLogger("F2Logger");
> 	log.Info("Some meaningful message);
> 
> When I look at the log variable, Info is false (as are all the other 
> levels). I've got a project reference to the .NET 1.1 release 
> log4net.dll (1.2 beta8).
> 
> Here's highlights from my config file:
> 
>   <configSections>
> 	<section name="log4net" 
> type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
>   </configSections>
> 
> 	<log4net debug="true">
> 		<appender name="EventLogAppender" 
> type="log4net.Appender.EventLogAppender" >
> 			<param name="LogName" value="Application" />
> 			<param name="ApplicationName" value="F2" />
> 			<layout type="log4net.Layout.PatternLayout">
> 				<param name="ConversionPattern" value="%d
> [%t] %-5p %c [%x] - %m%n" />
> 			</layout>
> 		</appender>
> 
> 		<root>
> 			<level value="DEBUG" />
> 		</root>
> 
> 		<logger name="F2Logger">
> 			<level value="INFO" />
> 			<appender-ref ref="EventLogAppender" />
> 		</logger>
> 	</log4net>
> 
> 
> I've already 'initialised' the event log to permit an application name 
> of F2. In any case, my issue occurs before we try to write to the 
> event log.
> 
> What am I doing wrong? It all seems so simple...
> Hope you can help.
> 
> Regards
> Michael
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.10.4 - Release Date:
> 27/04/2005
>  
> 
> 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 27/04/2005
 

The information transmitted by this e-mail message is intended solely for
the use of the person to whom or entity to which it is addressed. The
message may contain information that is privileged and confidential.
Disclosure, dissemination, distribution, review, retransmission to, other
use of or taking any action in reliance upon this information by anyone
other than the intended recipient is prohibited. If you are not the intended
recipient, please do not disseminate, distribute or copy this communication,
by e-mail or otherwise. Instead, please notify us immediately by return
e-mail (including the original message with your reply) and then delete and
discard all copies of the message.

Although we have taken precautions to minimize the risk of transmitting
viruses we nevertheless advise you to carry out your own virus checks on any
attachment to this message. We accept no liability for any loss or damage
caused by viruses.

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 27/04/2005