fix: Turn any log streaming related errors to warnings#876
Merged
Conversation
3be348d to
34ba9ca
Compare
34ba9ca to
431c428
Compare
barjin
approved these changes
Mar 26, 2026
Member
barjin
left a comment
There was a problem hiding this comment.
Nice, I didn't even hope it would be this simple 😄
I have one nit regarding the warning message formatting, otherwise lgtm. Thank you @Pijukatel !
src/resource_clients/log.ts
Outdated
| this.destinationLog.info(lastMessage); | ||
| } | ||
| } catch (err) { | ||
| this.destinationLog.warning(`Log redirection stopped due to error: ${JSON.stringify(err)}`); |
Member
There was a problem hiding this comment.
There is a second data parameter in all(?) Log methods (code), where you can pass structured data which gets serialized using the logger-wide rules. This might help with the err printing (JSON serialization just makes everything an opaque, one-line string)
Contributor
Author
There was a problem hiding this comment.
Good point. Also, it made me realize that this should be logged by the normal logger and not the redirect one, because this is not the log from the redirected actor run.
…oming from the other actor log
0617ccf to
0b879f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Errors in log streaming should not propagate further. Just log them as warnings.
Such errors should be fixed on API level: https://github.com/apify/apify-core/issues/26653
Issues
Closes: #873