For log4net configuration.. here is my parameter setting
<parameter>
<parameterName value="@exception"/>
<dbType value="String"/>
<size value="8000"/>
<layout type="log4net.Layout.ExceptionLayout"/>
</parameter>
</appender>
My stored proc in ADONetAppender is set as follows:
<commandText value="dbo.MyInsertProcName"/>
<commandType value="StoredProcedure"/>
Inside the proc, the input parameter for @exception is as follows:
ALTER PROCEDURE [dbo].[MyInsertProcName]
(
@log_date DATETIME
, @log_level VARCHAR(50)
, @logger VARCHAR(255)
, @message VARCHAR(4000)
, @exception VARCHAR(MAX)
....
The stored proc writes to the table "MYTable" which has "Exception" column length as VARCHAR 8000.
I am able to create entry into the "MYTable" but this entry does not contain the whole exception stack trace after entry is created. It looks like the stack trace is truncated and only contains upto to 1700 characters.
what is the best way of logging full stack trace to the database in log4net?
What am I missing?
Please help.
Thanks