logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmarun <nmar...@hotmail.com>
Subject AdoNetAppender for SQL db issue
Date Mon, 30 Apr 2007 17:29:10 GMT

Hi Log4Net developers/users,

I'm currently developing a logging mechanism for our company and I'm having
an issue with the below code - its not working!!

[code]
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
	<bufferSize value="100" />
	<threshold value="WARN" />
	<connectionType value="System.Data.SqlClient.SqlConnection, System.Data,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
	<connectionString value="Server=serverName;Database=Log4Net;User
ID=userID;Password=Password;Trusted_Connection=False" />
	<commandText value="INSERT INTO [Log]
([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES
('@log_date', '@thread', '@log_level', '@logger', '@message', '@exception')"
/>
	<parameter>
		<parameterName value="@log_date" />
		<dbType value="DateTime" />
		 <layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%d{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}" />
		 </layout>
	</parameter>
	<parameter>
		<parameterName value="@thread" />
		<dbType value="String" />
		<size value="255" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%thread" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@log_level" />
		<dbType value="String" />
		<size value="255" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%level" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@logger" />
		<dbType value="String" />
		<size value="255" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%logger" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@message" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%message" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@exception" />
		<dbType value="String" />
		<size value="2000" />
		<layout type="log4net.Layout.ExceptionLayout" />
	</parameter>
</appender>
[/code]

I'm writing a C# web app to test this and after run the code I do not see
any inserts in the database table. Please help.

Thanks
Arun
-- 
View this message in context: http://www.nabble.com/AdoNetAppender-for-SQL-db-issue-tf3670908.html#a10257423
Sent from the Log4net - Users mailing list archive at Nabble.com.


Mime
View raw message