Open thebarty opened 5 years ago
Ok I have found a solution to prevent crashes:
add this line to your config
handleExceptions: true, // see https://github.com/winstonjs/winston#exceptions
like
const papertrailLogger = new winston.transports.Papertrail({
// for options see https://github.com/kenperkins/winston-papertrail
host,
port,
level: 'info',
logFormat(level, message) {
return `[${level}] ${message}`
},
inlineMeta: true, // attach meta data inline (TODO switch it off completely see https://github.com/kenperkins/winston-papertrail/issues/85)
handleExceptions: true, // see https://github.com/winstonjs/winston#exceptions
})
I can provoke this locally by switching off WLAN.
The remaining problem is that AFTER LOOSING the connection once, it does NOT reconnect to papertrail.
Any idea how to have winston RECONNECT to papertrail?
I have same issue with no ability to reconnect. I have had that issue for a while now, it's rather annoying. If anybody has a fix for this it would be much appreciated.
Yes, having trouble with this issue too. We're trying to use this in an electron app context.
Been having the same issue for a while too, and switching to the syslog transport, or adding handleExceptions
to the transport and logger doesn't prevent the crash for my apps. I've been thinking of switching to http logs but I don't know if it's going to have the same problem too or if it's just going to be much slower.
Hi guys,
woohhhaaa! my winston setup crashes the process when the connection to papertrail is lost:
and
I wouldn't expect a pro-logger library to need a
try-catch
.Is this package still maintained?