<?xml version="1.0" encoding="utf-8" ?>
<log4net>
	<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
		<to value="YOUREMAILADDRESS" />
		<from value="YOURBLOG" />
		<subject value="Error occurred in YOUR BLOG" />
		<smtpHost value="YOURMAILSERVER" />
		<bufferSize value="256" />
		<lossy value="true" />
		<evaluator type="log4net.Core.LevelEvaluator">
			<threshold value="ERROR" />
		</evaluator>
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%-5p %d [ThreadId: %t] Class:%c{1} Method:%M %nMESSAGE:%n%m%n%n" />
		</layout>
	</appender>

  <appender name="FileAppender" type="log4net.Appender.FileAppender">
    <param name="File" value="subtext.log"/>
    <param name="AppendToFile" value="true"/>
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%-5p %m [%r] %d{ABSOLUTE}%n"/>
    </layout>
  </appender>

	<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
		<bufferSize value="1" />
		<evaluator type="log4net.Core.LevelEvaluator">
			<threshold value="DEBUG" />
		</evaluator>
		<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
		<connectionStringName value="subtextData" />
		<commandType value="StoredProcedure" />
		<commandText value="subtext_AddLogEntry" />
		<parameter>
			<parameterName value="@BlogId" />
			<dbType value="Int32" />
			<layout type="log4net.Layout.RawPropertyLayout">
				<key value="BlogId" />
			</layout>
		</parameter>
		<parameter>
			<parameterName value="@Date" />
			<dbType value="DateTime" />
			<layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}" />
		</parameter>
		<parameter>
			<parameterName value="@Thread" />
			<dbType value="String" />
			<size value="255" />
			<layout type="log4net.Layout.PatternLayout" value="%.255thread" />
		</parameter>
		<parameter>
			<parameterName value="@Context" />
			<dbType value="String" />
			<size value="512" />
			<layout type="log4net.Layout.PatternLayout" value="%.512ndc" />
		</parameter>
		<parameter>
			<parameterName value="@Level" />
			<dbType value="String" />
			<size value="20" />
			<layout type="log4net.Layout.PatternLayout" value="%.20level" />
		</parameter>
		<parameter>
			<parameterName value="@Logger" />
			<dbType value="String" />
			<size value="256" />
			<layout type="log4net.Layout.PatternLayout" value="%.256logger" />
		</parameter>
		<parameter>
			<parameterName value="@Message" />
			<dbType value="String" />
			<size value="255" />
			<layout type="log4net.Layout.PatternLayout" value="%.255message" />
		</parameter>
		<parameter>
			<parameterName value="@Exception" />
			<dbType value="String" />
			<size value="2745" />
			<layout type="log4net.Layout.ExceptionLayout" />
		</parameter>
		<parameter>
			<parameterName value="@Url" />
			<dbType value="String" />
			<size value="255" />
			<layout type="log4net.Layout.PatternLayout" value="%X{Url}" />
		</parameter>
	</appender>

	<root>
		<!-- Set this to "ERROR" before release -->
		<level value="ERROR" />
		<appender-ref ref="AdoNetAppender" />
		<!-- <appender-ref ref="SmtpAppender" /> -->
		<!--<appender-ref ref="FileAppender" /> -->
	</root>
</log4net>
