Closed
Description
Hello! When developing locally I set the log handler to "console", to not spam the live site.
datadogLogs.logger.setHandler(
process.env.DD_ENABLED === "true"
? HandlerType.http
: HandlerType.console
);
The downside to this is that I can't see the context values of the log, which makes this much less useful. This call to the logger:
datadogLogs.logger.info("Switching viewed account", {
from: oldAccount,
to: newAccount,
});
Results in this log to the console:
I can't see the "from" and "to" values I'm sending along, which makes these logs much less useful for debugging (if the handler were "http", I could see these values in the network tab). I end up having to go into the code and setting a console.log
if I want to debug things, whereas I would hope that datadog's logger would make that unnecessary.
Either way I hope you all are well, thank you!