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
The PHP Agent allows to forward logs directly to NR servers but don't allow us to filter which log records we want to send, causing the sending of unwanted logs and impacting in the account billing.
Desired Behavior
Allow to developers to filter which logs records they want to forward to New Relic.
Possible Solution
Monolog \Monolog\Logger class has a mandatory constructor argument (eg. string $name) which tells the name of the logger instance and that argument will be passed as channel to LogRecord when $logger->log(...) is called. Frameworks like Symfony creates multiples instances of \Monolog\Logger each one having a diferente name/channel (eg. request, messenger, security, etc). The agent could use the channel property and allow us to filter which log record will be sent to NR servers.
It would be great to have the channel value in the metadata of the logs as well, to be able to query it.
Being able to do query on it would also allow to create drop filters based on this value
Summary
The PHP Agent allows to forward logs directly to NR servers but don't allow us to filter which log records we want to send, causing the sending of unwanted logs and impacting in the account billing.
Desired Behavior
Allow to developers to filter which logs records they want to forward to New Relic.
Possible Solution
Monolog
\Monolog\Logger
class has a mandatory constructor argument (eg.string $name
) which tells the name of the logger instance and that argument will be passed aschannel
toLogRecord
when$logger->log(...)
is called. Frameworks like Symfony creates multiples instances of\Monolog\Logger
each one having a diferente name/channel (eg.request
,messenger
,security
, etc). The agent could use thechannel
property and allow us to filter which log record will be sent to NR servers.Consider my application has 3 log channels:
Now I want to send only
app
anddoctrine
channels to NR servers, I could configure the agent like this:newrelic.application_logging.forwarding.monolog_channels_include=app,doctrine
Or
newrelic.application_logging.forwarding.monolog_channels_exclude=security
Additional context
I have undesired log records being sent to NR servers.
The text was updated successfully, but these errors were encountered: