i’m new to serilog and so and i am trying to use serilog to log into a mysql 5.7 database.
and i am getting this error from the mysql server, for which i couldn’t find any solution online:
Aborted connection 23 to db: 'serilog' user: 'root' host: 'localhost' (Got an error reading communication packets) For more information, see Help and Support Center at http://www.mysql.com.
i have set up a visual studio 2022 .net 7 console app using serilog.sinks.mysql (5.0.0).
this is the test code:
Serilog.Debugging.SelfLog.Enable(Console.Error);
using var log = new LoggerConfiguration()
.WriteTo.MySQL("server=127.0.0.1;uid=root;pwd=***;database=serilog", "serilog", Serilog.Events.LogEventLevel.Verbose)
.CreateLogger();
log.Information("hello, serilog");
the connection string was working for another project in an ef core db context.
the debug console tells me:
2024-05-22T12:06:27.2690920Z Halting sink...
2024-05-22T12:06:27.2724566Z Sending batch of 1 logs
2024-05-22T12:06:27.3249267Z Sink halted successfully.
how would i best dig into the nature of the connection error? any hints would be greatly appreciated. thanks.
paddleball is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.