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
It is possible to setup both console and http handler for a logger, but AFAIK it is not possible to configure different levels for the handlers.
I would like to have debug level for console and info for http (more data in browser console, less data on DD servers).
My current workaround is to have the level defined as debug and using beforeSend event to filter out debug level messages from sending to DD servers, it works but more explicit/declarative API would be nice.
The text was updated successfully, but these errors were encountered:
Thank you for reaching out. Are you looking for the configuration forwardConsoleLogs? It provides the ability to forward console logs at different levels.
If I were to switch to log forwarding, then all the console calls (of certain level) would be captured, right? The issue here is that some entries to console are inserted by code outside of my control, hence the preference to use DD logger.
Hello @morzel85,
One way to have different levels for the handlers could be to create different loggers with the createLogger API. Let me know if that answer your question.
Using two different loggers would be more complex than the beforeSend filter 'trick' I use now. With single logger, the code that does the logging (creates entries) doesn't need to be aware of any destination config.
@morzel85,
I understand that using beforeSend might be more convenient in your case, and I think it’s a good workaround. I’ll let you know when we have an alternative solution for this.
It is possible to setup both
console
andhttp
handler for a logger, but AFAIK it is not possible to configure different levels for the handlers.I would like to have
debug
level forconsole
andinfo
forhttp
(more data in browser console, less data on DD servers).My current workaround is to have the level defined as
debug
and usingbeforeSend
event to filter outdebug
level messages from sending to DD servers, it works but more explicit/declarative API would be nice.The text was updated successfully, but these errors were encountered: