Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/log4net/Appender/AdoNetAppender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,17 @@ protected virtual void SendBuffer(IDbTransaction dbTran, LoggingEvent[] events)
{
dbCmd.Transaction = dbTran;
}
// prepare the command, which is significantly faster
dbCmd.Prepare();

try
{
// prepare the command, which is significantly faster
dbCmd.Prepare();
}
catch (Exception)
{
// ignore prepare exceptions as they can happen without affecting actual logging, eg on npgsql
}

// run for all events
foreach (LoggingEvent e in events)
{
Expand Down