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

Append log splats to Loggly message object #58

Merged
merged 1 commit into from Mar 31, 2020
Merged

Conversation

@valeriansaliou
Copy link

@valeriansaliou valeriansaliou commented Jan 6, 2020

Hello there!

After moving over to Winston 3 from Winston 2, I noticed that Winston was now appending all extra logging arguments as "Symbol(splats)" in the final "message" log object.

Specific actions have to be taken in order to forward those splats to Loggly, as extra arguments are not anymore being forwarded to Loggly.

Depending on the logging pattern in a project, splats could contain an Error object, a plain JS object, or a string message. For instance, calling log.error("An error occured:", new Error("Nah!")) would set "An error occured:" as message.message, but would not forward the Error object to Loggly. This PR addresses this "regression" after an upgrade from Winston 2 to 3.

Notice: splats is an array of all extra values passed to the logging function. Providing 4 arguments to the logging call would induce a splats object of length 3.

@alestrunda alestrunda merged commit 6599016 into loggly:master Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.