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
Info logs are successfully being sent to datadog, but error and warning logs are not.
Unhandled exceptions are being logged somehow though, just not errors I specifically log.
I see no errors in the console to explain why they are not being sent
[Update] the last logs before exiting disappear. Usually it's errors and warnings that don't get logged, perhaps because they are bigger log messages than other logs due to error stacktraces etc
What version of Winston presents the issue?
v3.10.0
What version of Node are you using?
v18.16.1
If this worked in a previous version of Winston, which was it?
Hi,
I have more or less the same problem. Somehow my custom format won't apply if I use new transports.Http(httpTransportOptions, {format: myCustomFormat}). If I output it via transport.console it outputs valid JSON. But Datadog receives just an unformatted version of it. Maybe this info helps a bit.
Locking deeper into the API request I got this:
request! {
service: 'my-service',
context: 'foo',
level: 'error',
message: 'This is a server log',
timestamp: '2024-03-15T06:55:18.096Z',
[Symbol(level)]: 'error',
[Symbol(splat)]: [ { context: 'foo' } ],
[Symbol(message)]: 'my-service - - [2024-03-15T06:55:18.096Z] - [error]: This is a server log'
}
After googling around a stack overflow post suggested something similar to this
importprocessfrom'node:process'import{Logger}from'../logger/logger'functionsleep(milliseconds: number){returnnewPromise((resolve)=>{setTimeout(resolve,milliseconds)})}/** Allows processes to finish before exiting. * Before this, winston HTTP transport logs weren't being sent to datadog when a process.exit() command was called */exportasyncfunctionexitGracefully(exitCode: number,milliseconds: number=1500){Logger?.debug('Exiting',{exit_code: exitCode})awaitsleep(milliseconds)process.exit(exitCode)}
🔎 Search Terms
HTTP error, http datadog, http warning
The problem
Info logs are successfully being sent to datadog, but error and warning logs are not.
Unhandled exceptions are being logged somehow though, just not errors I specifically log.
I see no errors in the console to explain why they are not being sent
[Update] the last logs before exiting disappear. Usually it's errors and warnings that don't get logged, perhaps because they are bigger log messages than other logs due to error stacktraces etc
What version of Winston presents the issue?
v3.10.0
What version of Node are you using?
v18.16.1
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
Additional information
No response
The text was updated successfully, but these errors were encountered: