-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sink silently failing in Console app. #17
Comments
FINALLY When you starting test console app often this app works some seconds, and closes I saw source code, and i think Serilog worls with DB MySQL slowly, because there using StringBuilder() constructions to build query to DB and queryExec, it slowly therefore you app need work longer than 4 seconds)) MY FINALLY WORKS CODE:
JSON
Hello, i have a same problem with mysql and serilog, i try to find solution You switch on: Serilog.Debugging.SelfLog.Enable(Console.Error); you should switch on it before serilog configuration, and you will see process of configuring, of try to connect and create table in mysql My problem was (Console output):
Read more and interesting
It was source code, i compiled my project with this nuget:
i had this c# code:
if it console app, you soud add Console.ReadLine(); in end, therefore you program can ends before log in DataBase i had this json configuration file
went through the code with a debugger (in some places i needed to use only steps without F5, program can jump around MySQL log Query Code) and i find exception in sending message like: "Unknown column 'Template' in 'field' list" |
I have both a web app and a console app (both .NET Core 3.1) that I am trying to add the MySql sink to. They share identical appsettings.json files, and the standard console sink works on both. However, I can only see logs written through the MySql sink when running the web app. My console app only logs to the console sink, not the MySql sink. I enabled the SelfLog to show the output to console, and it shows "Sending batch of 1 logs" but I see nothing else to indicate an error in the MySql sink. The only difference is in the inherent difference in setting up a logger for a console app vs the web host.
I have tried "manually" configuring the sinks instead of reading from appsettings.json, and I get the exact same output (logs write to console, not to MySql). My console app logic is below. Again, this same configuration works in the web app, so there is either an issue with my console logic, an issue in the Sink, or an error happening inside the sink (like permissions?) that is not getting surfaced through the SelfLog. What am I missing?
The text was updated successfully, but these errors were encountered: