79276288

Date: 2024-12-12 19:05:59
Score: 1.5
Natty:
Report link

For those who are also having the same issue, it seems that AdoNetAppender is now supported, as I was able to make it work with only the microsoft package "Microsoft.Extensions.Logging.Log4Net.AspNetCore".

What helped me finding the error was looking into the above mentioned MicroKnights.Log4NetAdoNetAppender github page. There they mention that the SqlConnection class changed place at some point. So changing the "connectionType" element value as their suggestion fixed the issue for me.

Before (not working): <connectionType value="System.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

After (working): <connectionType value="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient, Version=1.0.0.0,Culture=neutral,PublicKeyToken=23ec7fc2d6eaa4a5"/>

The old not functional version I had copied from the log4net official docs: https://logging.apache.org/log4net/release/config-examples.html

Note: I am on .net8, and after checking the Microsoft.Data.SqlClient package, I updated the above to match the latest version: <connectionType value="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient, Version=5.0.0.0,Culture=neutral,PublicKeyToken=23ec7fc2d6eaa4a5"/>

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): also having the same issue
  • Low reputation (0.5):
Posted by: Fernando Wolff