logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Kunz" <marcel.k...@VITODATA.CH>
Subject RE: Exception Logging
Date Wed, 08 Dec 2004 14:36:44 GMT
Because your StackTrace is Null/Nothing. As long as you don't throw the exception the StackTrace
will be 'Null'.

Tschüss
Marcel
 

Vitodata AG, Marcel Kunz
Dipl. IT Ing. FH
Deisrütistrasse 10, CH-8472 Ohringen
Telefon +41 (0)52 320 55 55, Fax +41 (0)52 320 55 66
Telefon direkt +41 (0)52 320 56 64
mailto:marcel.kunz@vitodata.ch



-----Original Message-----
From: Annette Sündermann [mailto:suendermann@sycada.com] 
Sent: Wednesday, December 08, 2004 3:25 PM
To: log4net-user@logging.apache.org
Subject: Exception Logging


I am using log4net 1.2.0 beta 8.

According to the documentation, the following code:

this.logger.Error ( "exception observed!", new Exception("I am an Exception") );

should 

'Log a message object with the ERROR level including the stack trace of the Exception passed
as a parameter.'

On my logfile, I only find the following text:

2004-12-08 15:21:51,171 ERROR FormPoc.Form1_Load[376]
exception observed!
Exception: System.Exception
Message: I am an Exception

No StackTrace is logged.

My log4net configuration is:
	<log4net>
		<!-- Define a Rolling File Appender -->
		<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
			<param name="File" value="G:/MTraceReports/MReport/log/Poc.log"/>
			<param name="AppendToFile" value="true"/>
			<param name="RollingStyle" value="Size"/>
			<param name="MaxSizeRollBackups" value="10"/>
			<param name="MaximumFileSize" value="1MB"/>
			<param name="StaticLogFileName" value="true"/>
			<layout type="log4net.Layout.PatternLayout">
				<param name="ConversionPattern" value="%d{ISO8601} %-5p %C{1}.%M[%L]%n%m%n"/>
			</layout>
		</appender>
		<!-- Set root logger level to DEBUG and add the RollingFileAppender -->
		<root>
			<level value="ALL"/>
			<appender-ref ref="RollingFileAppender"/>
		</root>
	</log4net>

What is the reason for the missing StackTrace?





Mime
View raw message