You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to use the new logcontext v2, but continue using a JSON formatter that extracts the different logrus fields into individual fields in the log details in New Relic Logs.
Desired Behaviour
In our applications we use logcontext v1 (https://github.com/newrelic/go-agent/tree/master/v3/integrations/logcontext) together with the nrlogrusplugin. We have seen there is now a v2 available for logcontext. We would like to use this new version as it is able to easily annotate log statements outside of a transaction. Otherwise, we need to rely on something like
which seems a little bit too much just to log a message.
The issue with using logcontext v2 is that we have not been able to use a JSON formatter (New Relic's documentation only mentions the TextFormatter, so we wonder if it is the only one supported at this moment). We have tried:
and while we do see the logs on New Relic, the JSON fields are not extracted and they are simply listed in the log message field (as a string, instead of individual fields). That means we cannot easily query using NRQL.
Is it actually possible to use a JSON formatter with logcontext v2 and still get the old behavior (where the different JSON fields get extracted and are available in New Relic Logs)?
The text was updated successfully, but these errors were encountered:
Hi, we fully support ANY valid logrus formatter, since we are able to extract the value from the logrus fields before they get formatted. This is correctly labeled as an enhancement, and is something we are planning to bring to the v2 logging products in the future.
Do you have any timeline for this? In the meanwhile, do you have any suggestion other than doing something along the lines of the solution mentioned above? The one using logcontext v1 and this "trick":
Summary
We would like to use the new
logcontext
v2, but continue using a JSON formatter that extracts the different logrus fields into individual fields in the log details in New Relic Logs.Desired Behaviour
In our applications we use
logcontext
v1 (https://github.com/newrelic/go-agent/tree/master/v3/integrations/logcontext) together with thenrlogrusplugin
. We have seen there is now a v2 available forlogcontext
. We would like to use this new version as it is able to easily annotate log statements outside of a transaction. Otherwise, we need to rely on something likewhich seems a little bit too much just to log a message.
The issue with using
logcontext
v2 is that we have not been able to use a JSON formatter (New Relic's documentation only mentions theTextFormatter
, so we wonder if it is the only one supported at this moment). We have tried:and while we do see the logs on New Relic, the JSON fields are not extracted and they are simply listed in the log message field (as a string, instead of individual fields). That means we cannot easily query using NRQL.
Is it actually possible to use a JSON formatter with
logcontext
v2 and still get the old behavior (where the different JSON fields get extracted and are available in New Relic Logs)?The text was updated successfully, but these errors were encountered: