Skip to content
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

Open
ashleydavis opened this issue Aug 9, 2015 · 3 comments
Open

Allow pipeline errors to be logged by the same pipeline #21

ashleydavis opened this issue Aug 9, 2015 · 3 comments
Milestone

Comments

@ashleydavis
Copy link
Contributor

StructuredLog has these functions selfLog and notSelfLog. They return functions that query a log property isSelfLog.

What is the purpose of this self log feature?

@nblumhardt
Copy link
Contributor

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 :-)

isSelfLog etc. prevents this, but does so in a way that hopefully permits a failure in one sink to be surfaced via another.

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.

@ashleydavis
Copy link
Contributor Author

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.

@Wedvich
Copy link
Collaborator

Wedvich commented Jan 18, 2017

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.

@Wedvich Wedvich added this to the v0.2.0 milestone Jan 18, 2017
@Wedvich Wedvich changed the title What is the purpose of the selfLog/notSelfLog functions? Allow pipeline errors to be logged by the same pipeline Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants