You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
We are using the OnException method to register a callback for handling exceptions. In that callback, we create a custom log entry like so:
service.OnException(ex =>{// some more logic ... Log.Fatal(ex,"An unhandled exception occurred in service.")// our custom log entry (simplified)});
When running the service as console application, unhandled exceptions are logged twice, because in the ConsoleRunHost implementation, an error is logged too:
I'm not quite sure how to turn off only the internal log messages of the library. Do you have an example how to achieve that? (We are using Serilog btw.)
For our setup, it would actually be OK to log internal messages - especially the Information messages when a service starts or stops are relevant. So maybe there is a way to just ignore the above stated Error message in case of an exception?
Hi!
We are using the
OnException
method to register a callback for handling exceptions. In that callback, we create a custom log entry like so:When running the service as console application, unhandled exceptions are logged twice, because in the
ConsoleRunHost
implementation, an error is logged too:Topshelf/src/Topshelf/Hosts/ConsoleRunHost.cs
Line 106 in 22baba8
Any thoughts on how to suppress the hardcoded
_log.Error(...)
call in theConsoleRunHost
?The text was updated successfully, but these errors were encountered: