Class: NewRelicLoggingService

Logging.NewRelicLoggingService()

The NewRelicLoggingService is a concrete implementation of the logging service interface that sends messages to NewRelic that can be seen in NewRelic Browser and NewRelic Insights. When in development mode, all messages will instead be sent to the console.

When you use logError, your errors will be checked to see if they're ignored or not. Not-ignored errors will appear under "JS errors" for your Browser application.

SELECT * from JavaScriptError WHERE errorStatus is not null SINCE 10 days ago

Ignored errors will appear in New Relic Insights as page actions, which can be queried:

SELECT * from PageAction WHERE actionName = 'IGNORED_ERROR' SINCE 1 hour ago

When using logInfo, these only appear in New Relic Insights when querying for page actions as follows:

SELECT * from PageAction WHERE actionName = 'INFO' SINCE 1 hour ago

You can also add your own custom metrics as an additional argument, or see the code to find other standard custom attributes. By default, userId is added (via setCustomAttribute) for logged in users via the auth service (AuthAxiosJwtService).

Requires the NewRelic Browser JavaScript snippet.