I'm inserting Log4Net events into a SQL database. The Message and Exception fields are both 8000 characters, but occasionally, an event will come through that is longer than 8000 characters, and the data is getting truncated.
Is there any configurable way to get it to chunk out the events into multiple rows? If not, I'm currently thinking about implementing my own ILog that automatically handles chunking the logging events up so I don't get any truncated data. Does anyone have a better idea?
Here is my current parameter Configuration:
<parameter>
<parameterName value="@message"/>
<dbType value="String"/>
<size value="8000"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message"/>
</layout>
</parameter>
<parameter>
<parameterName value="@exception"/>
<dbType value="String"/>
<size value="8000"/>
<layout type="log4net.Layout.ExceptionLayout"/>
</parameter>
The database tables are defined as such:
[Message] [nvarchar](max) NULL,
[Exeception] [ntext] NULL,
You have to set the size value attribute to -1. This will save the whole exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With