logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Haughton" <Neil.Haugh...@autoscribe.co.uk>
Subject RE: Problem getting Log4net to work
Date Tue, 13 May 2008 10:22:39 GMT
Thanks for responding. My mistake and I've corrected it, but it doesn't
make a difference:

<?xml version="1.0" encoding="utf-8" ?>
	<log4net>


...

		<appender name="RollingFileAppenderTRACE"
type="log4net.Appender.RollingFileAppender">
			<file value="c:\logs\MatrixTRACE.log" />
			<layout type="log4net.Layout.PatternLayout">
				<conversionPattern value="%m%newline" />
			</layout>
			<appendToFile value="true" />
			<maximumFileSize value="100KB" />
			<maxSizeRollBackups value="2" />
		</appender>
...

		<logger name="Matrix.Trace">
			 <!--this is for routine debug logging to a
file--> 
			<level value="DEBUG" />
			<appender-ref ref="RollingFileAppenderTRACE" />
		</logger>
...
	</log4net>

(This is the config file in the executable directory).

Regards,
Neil

-----Original Message-----
From: Dag Christensen [mailto:Dag.Christensen@vismaretail.no] 
Sent: 13 May 2008 10:46
To: Log4NET User
Subject: RE: Problem getting Log4net to work

The top level node should be log4net when you're using a stand-alone
configuration file, not configuration. Configuration is afaik only used
in app.config files.

Regards,
Dag


-----Original Message-----
From: Neil Haughton [mailto:Neil.Haughton@autoscribe.co.uk] 

*snip*

The bare bones of the log4net.config file is:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <log4net>


        <appender name="RollingFileAppenderROOT"
type="log4net.Appender.RollingFileAppender">
            <file value="c:\logs\MatrixROOT.log" />
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%m%newline" />
            </layout>
            <appendToFile value="true" />
            <maximumFileSize value="100KB" />
            <maxSizeRollBackups value="2" />
        </appender>


        <appender name="RollingFileAppenderTRACE"
type="log4net.Appender.RollingFileAppender">
            <file value="c:\logs\MatrixTRACE.log" />
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%m%newline" />
            </layout>
            <appendToFile value="true" />
            <maximumFileSize value="100KB" />
            <maxSizeRollBackups value="2" />
        </appender>


        <root>
            <appender-ref ref="RollingFileAppenderROOT" />
        </root>

        <logger name="Matrix.Trace">
             <!--this is for routine debug logging to a file--> 
            <level value="DEBUG" />
            <appender-ref ref="RollingFileAppenderTRACE" />
        </logger>

    </log4net>
</configuration>


TIA

Neil


###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft
Exchange.
For more information, connect to http://www.f-secure.com/



Mime
View raw message