Open morzel85 opened 1 week ago
Hi @morzel85 ,
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.
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.