-
Notifications
You must be signed in to change notification settings - Fork 31
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
Allow pipeline errors to be logged by the same pipeline #21
Comments
https://github.com/structured-log/structured-log/blob/dev/src/core/structured-log.js#L367 Sometimes an error may occur in the pipeline itself, or a sink (perhaps a 401 comes back from a service call, a file is locked, etc.) structured-log surfaces these by sending them down the logging pipeline - which, if you consider the origin of the error - might lead to an Inception-like recursive situation :-)
The corresponding Serilog feature this is based on is here: https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics#selflog Serilog's self-log is a separate pipeline, which has some advantages but has also made the feature very limited and not-too-discoverable. The JS one is hopefully much improved. |
Ok make sense. In commit 64abbe5 I converted over to passing arrays of log events through the pipeline rather than single log events. This was to support batching and having all sinks be batchable. I've removed some code related to this that doesn't seem to make sense anymore. Please look through the commit, you'll see that I've created a line note where the self log functionality has been modified and is possibly broken now. Be good to get your comments on this. |
In the new version, errors are suppressed by default, but can explicitly be allowed to propagate. However, they're not captured by the pipeline in any way, and will be thrown to the environment in those cases. It would make sense to support some sort of "automated" self-logging again by pumping errors back into the pipeline and tagging them somehow. |
StructuredLog
has these functionsselfLog
andnotSelfLog
. They return functions that query a log propertyisSelfLog
.What is the purpose of this self log feature?
The text was updated successfully, but these errors were encountered: