Output errors to Serilog.SelfLog for exceptions #238
Labels
feature-request
A feature should be added or improved.
module/logging
p2
This is a standard priority issue
queued
Describe the feature
Serilog has a facility that allows components to report errors during operation. The AWS Serilog Sink should report errors to this SelfLog. https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics
Use Case
Our application uses multiple sinks, for example a sqlserver sink, and errors from those sinks are logged in the Selflog. Our applications plugs in to the self log and will report itself as unhealthy if there are messages in the self log. We also record this logs for later inspection, and display it in a verbose healthcheck for the dev environment.
The AWSSerilog sink however only writes errors to a text file
aws-logger-errors.txt
for logging errors. However this file may never be created depending on the rights of the user account, for example in hardenedProposed Solution
AWSLoggerCore
should expose a new optional constructor argument or a new constructor overload with an argumentAction<string> onError
. If this is set, theLogLibraryServiceError
method should invoke this delegate instead of creating the log file. AWSSink will then use this method write to the SelfLog.Creating an optional constructor argument will be a binary breaking change, but creating a new overload will not produce a breaking change.
Other Information
No response
Acknowledgements
AWS .NET SDK and/or Package version used
AWS.Logger.SeriLog 3.3.0
Targeted .NET Platform
.NET 6, .NET 8
Operating System and version
Linux .NET docker containers
The text was updated successfully, but these errors were encountered: