-
Notifications
You must be signed in to change notification settings - Fork 603
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
Add log forwarding support for for semantic_logger
#2453
Comments
I don't suppose there's any progress or timeline on this? I'm looking at switching our regular Rails logs to one of the structured logging gems, and was leaning towards semantic_logger. |
Hi @jdelStrother! Your supposition is valid and we don't have any progress or estimates to share at this time. But here are two things we can share:
|
Semantic Logger has a New Relic appender which obviates the need for explicit support from New Relic. It was merged last year in 4.13.0. reidmorrison/semantic_logger#248 Here's how I'm using it on Heroku:
|
@jon-rse ooh, thanks - will take a look |
@jon-rse I see what you mean about the json mess. I find I need to switch to NewRelic's overly-verbose log_summary view to get the information I need, which is really clunky. I kind of wonder if it would be better if the |
@jdelStrother One option that we're currently implementing with another json logging library, LogStasher, is adding key/values as attributes on the log event, which show up as filterable values in the UI. LogStasher events don't include certain attributes like |
(Apologies if we're getting off topic here - some of it is possibly more about the NewRelic Logs UI. But hopefully it's still relevant, since it might just be fixed by sending differently structured log data...) I kind of miss my old-fashioned plain dumb text log workflow, where I could rely on having a single When tracing an error in a specific transaction I often don't know what metadata columns might be needed ahead of time. With structured logs, if the app logs something like SemanticLogger's NewRelic formatter nests both the log message and payload metadata under the
and I need to show the |
We hear you on the question of how to organize json logs in the UI—we ran into similar challenges with LogStasher instrumentation. We considered a few different ways to strucutre the data, but decided we didn't want to make decisions for all customers on field reporting or appearance. So instead we decided it would be best to report logs as close are we could to their original form, which means key/value pairs and filterable log attributes. SemanticLogger's instrumentation is inline with how we'd intend nested keys to be reported. Here is where we do it for LogStasher. We have an open feature request to add custom attributes to logs, which would allow you to create an interpolated string with the values you want, for example. If you'd like to show support for this, I'd encourage you to comment or 'react' on that PR. That could help bump it in priority. We also always welcome PRs ◡̈ |
@jdelStrother @jon-rse @hannahramadan The initial implementation of the NR Log Formatter for Semantic Logger incorrectly nested almost everything under I've created a PR upstream to address this along with a few other changes I thought made sense (unnesting key/values from named_tags). reidmorrison/semantic_logger#307 Hope you folks have an excellent New Years. |
semantic_logger
is a popular Ruby logging library. Currently, the Ruby agent does not support automatic forwarding for logging libraries that format their logs in JSON.The work in #2399 is similar to this, since both libraries use JSON-style logs.
While working on this, also verify whether
rails_semantic_logger
needs additional work to support forwarding.The text was updated successfully, but these errors were encountered: