logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Deviney <JDevi...@TWIA.ORG>
Subject RE: Log File Not Created with Pure XML Configuration
Date Fri, 24 Jun 2005 15:42:01 GMT
Nicko,

I tried this option and it did not work.

My App.config contained:

	   <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>

My AssemblyInfo.cs contained (I tried both):

	   [assembly: log4net.Config.XmlConfigurator]
	   [assembly:
log4net.Config.XmlConfigurator(ConfigFileExtension="log4net"]

No api call to load the configuration.  

Result, no log file is created.

John Deviney
Texas Windstorm Insurance Association
5700 S. MoPac Exp., Building E, Suite 530
Austin, TX 78749
jdeviney@twia.org


-----Original Message-----
From: Nicko Cadell [mailto:nicko@neoworks.com]
Sent: Friday, June 24, 2005 10:16 AM
To: Log4NET User
Subject: RE: Log File Not Created with Pure XML Configuration


Scott,

For configuring log4net you have 2 options. The first is programmatic
configuration, i.e. calling XmlConfigurator.Configure(new
System.IO.FileInfo(...)). The other alternative is to add an assembly
level attribute to your assembly which instructs log4net where to load
the config data from.

If you want to load the config from the applications .config file you
should add the following attribute to your assembly:

[assembly: log4net.Config.XmlConfigurator]


More details can be found here:
http://logging.apache.org/log4net/release/manual/configuration.html#attr
ibutes

Cheers,

Nicko

> -----Original Message-----
> From: Scott Wojan [mailto:SWojan@trammellcrow.com] 
> Sent: 23 June 2005 21:41
> To: Log4NET User
> Subject: RE: Log File Not Created with Pure XML Configuration
> 
> Then it can't be a security issue... 
> Local admin can do whatever it wants.
> 
> Anyone else got any suggestions???
> 
> Scott 
> 
> -----Original Message-----
> From: John Deviney [mailto:johnhdeviney@yahoo.com]
> Sent: Thursday, June 23, 2005 3:38 PM
> To: Log4NET User
> Subject: RE: Log File Not Created with Pure XML Configuration
> 
> Yes, running on my local pc and trying to log to same using 
> the local administrator account on 2000 Pro. 
> Same result running under a domain account with local admin 
> privileges.
> 
> John
> 
> --- Scott Wojan <SWojan@trammellcrow.com> wrote:
> 
> > John,
> > 
> > Exes will run under the security credentials of the user 
> that started 
> > them (unless you specify someone else using "Run As"). If 
> the account 
> > you are using does not have write permission to the directory it is 
> > trying to log to then it won't/can't be created.
> > 
> > When you tested the "C# windows exe" was it running on your 
> local PC?
> > Were you trying to write it to a folder on your local PC?
> > 
> > Scott
> >  
> > 
> > -----Original Message-----
> > From: John Deviney [mailto:johnhdeviney@yahoo.com]
> > Sent: Thursday, June 23, 2005 3:15 PM
> > To: Log4NET User
> > Subject: RE: Log File Not Created with Pure XML Configuration
> > 
> > Thanks for the response.
> > 
> > Could this be a security issue?  I tested a pure xml 
> configuration in 
> > a simple C# windows exe and had the same problem, no log 
> file created 
> > and no evidence of a configuration being loaded in log4net debug.
> > 
> > I thought a pure win exe had full access by default to 
> everything on a
> 
> > local machine including the file system.  The log4net docs 
> mentioned a
> 
> > possible security issue if you used a non-application 
> config xml file 
> > but not if you configure through the App.config.
> > 
> > Could this be a bug in log4net?
> > 
> > John
> > 
> > --- Scott Wojan <SWojan@trammellcrow.com> wrote:
> > 
> > > John,
> > > 
> > > I just tested the config file you sent (both ways)
> > and it seems to
> > > work for me.
> > > I'm sorry, I guess you'll have to wait for someone
> > more familiar with
> > > it than I am.
> > > 
> > > Thanks,
> > > Scott
> > > 
> > > 
> > >  
> > > 
> > > -----Original Message-----
> > > From: John Deviney [mailto:JDeviney@TWIA.ORG]
> > > Sent: Wednesday, June 22, 2005 12:35 PM
> > > To: 'Log4NET User'
> > > Subject: RE: Log File Not Created with Pure XML
> > Configuration
> > > 
> > > Yes, that was the only change.  I did leave out
> > some additional
> > > configuration unrelated to log4net for brevity.
> > > Here is the complete
> > > App.config just in case something else in the file
> > might be causing a
> > > problem.  Also, we are using an interop product,
> > JNBridge, to allow a
> > > C# client to talk to a Java server.  So, there are
> > actually several
> > > other jnbridge assemblies that are referenced
> > indirectly.
> > > 
> > > <?xml version="1.0" encoding="utf-8" ?>
> > <configuration>
> > > 
> > >    <configSections>
> > > 
> > > 	   <!-- section name="log4net"
> > > type="System.Configuration.IgnoreSectionHandler,
> > > log4net"/ -->	   
> > > 	   <section name="log4net"
> > >
> >
> type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
> > > 
> > >   	   <sectionGroup name="jnbridge">
> > > 		   <section name="dotNetToJavaConfig"
> > > 	
> > >
> >
> type="System.Configuration.SingleTagSectionHandler"/>
> > > 		   <section name="javaToDotNetConfig"
> > > 	
> > >
> >
> type="System.Configuration.SingleTagSectionHandler"/>
> > > 		   <section name="tcpNoDelay"
> > > 	
> > >
> >
> type="System.Configuration.SingleTagSectionHandler"/>
> > > 		   <section name="javaSideDeclarations"
> > > 	
> > >
> >
> type="System.Configuration.NameValueSectionHandler"/>
> > > 	   </sectionGroup>
> > >    </configSections>
> > > 	
> > > 	<system.windows.forms jitDebugging="true" />
> > > 	
> > > 	<appSettings>
> > > 	   <add key="activedirectory.server"
> > value="eagle"
> > > />
> > > 	   <add key="activedirectory.port" value="389" />
> > > 	   <add key="activedirectory.parentNode"
> > > value="DC=twia,DC=org"
> > > />
> > > 	   <add key="log4net.Internal.Debug"
> > value="true"/>
> > > 	</appSettings>
> > > 		
> > >    <log4net>
> > > 	   <appender name="LogFileAppender"
> > > type="log4net.Appender.FileAppender">
> > > 		   <param name="File" value=".//tos.net-ri.log"
> > />
> > > 
> > > 			<param name="AppendToFile" value="false" />
> > > 			<layout type="log4net.Layout.PatternLayout">
> > > 				<param name="Header" value="[Entry]\r\n"
> > > />
> > > 				<param name="Footer" value="[Exit]\r\n"
> > > />
> > > 				<param name="ConversionPattern"
> > > value="%d %-4r [%t] %-5p %c %x - %m%n" />
> > > 			</layout>
> > > 		</appender>
> > > 		<root>
> > > 			<level value="DEBUG" />
> > > 			<appender-ref ref="LogFileAppender" />
> > > 		</root>
> > > 	</log4net>
> > > 	
> > > 	<jnbridge>
> > > 		<dotNetToJavaConfig 
> > > 			scheme="sharedmem"		
> > > 			jvm="E:/j2sdk1.4.2_05/jre/bin/server/jvm.dll"
> > > 	
> > >
> >
> jnbcore="../../../tbot-server-proxy/depends/java/jnbcore.jar"
> > > 	
> > >
> >
> bcel="../../../tbot-server-proxy/depends/java/bcel-5.1-jnbridge.jar"
> > > 	
> > >
> >
> classpath="../../../tbot-server-proxy/depends/java/commons-col
> lections-2
> > > .1.1
> > >
> >
> .jar;../../../tbot-server-proxy/depends/java/commons-logging-1
> .0.4.jar;.
> > > ./..
> > >
> >
> /../tbot-server-proxy/depends/java/log4j-1.2.8.jar;../../../tb
> ot-server-
> > > prox
> > >
> >
> y/depends/java/hibernate3.jar;../../../tbot-server-proxy/depen
> ds/java/jb
> > > ossa
> > >
> >
> ll-client.jar;../../../tbot-server-proxy/depends/java;../../..
> /tbot-serv
> > > er-p
> > >
> >
> roxy/depends/java/common.jar;../../../tbot-server-proxy/depend
> s/java/tbo
> > > t-sy
> > >
> >
> stem.jar;../../../tbot-server-proxy/depends/java/tbot-ejb.jar;
> ../../../t
> > > bot-
> > >
> >
> server-proxy/depends/java/client.jar;../../../tbot-server-prox
> y/depends/
> > > java
> > >
> >
> /tbot-test.jar;../../../tbot-server-proxy/depends/java/thirdPa
> rtyTools.j
> > > ar;.
> > >
> >
> ./../../tbot-server-proxy/depends/java/commons-validator-1.1.4
> .jar;../..
> > > /../
> > >
> >
> tbot-server-proxy/depends/java/commons-digester-1.5.jar;../../
> ../tbot-se
> > > rver
> > > -proxy/depends/java/commons-beanutils.jar"
> > > 			jvmOptions.0="-Xmx400m"
> > > 	
> > >
> >
> jvmOptions.1="-Djava.security.auth.login.config=file:../../../
> tbot-serve
> > > r-pr
> > 
> === message truncated ===
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection 
> around http://mail.yahoo.com 
> ++++++CONFIDENTIALITY NOTICE++++++
> The information in this email may be confidential and/or 
> privileged. This email is intended to be reviewed by only the 
> individual or organization named above. If you are not the 
> intended recipient or an authorized representative of the 
> intended recipient, you are hereby notified that any review, 
> dissemination or copying of this email and its attachments, 
> if any, or the information contained herein is prohibited. If 
> you have received this email in error, please immediately 
> notify the sender by return email and delete this email from 
> your system.
> 

Mime
View raw message