winstonjs/winston-syslog

Unable to change appName without reinstantiation

Closed this issue · 1 comments

I'm working on a tool that runs custom batch processing on a Kinesis stream containing logs from different hosts/applications then forwards each entry to a log aggregator service. However, winston-syslog requires me to re-instantiate the transport/logger every time I want to change appName because appName is only passed to the Producer on instantiation whereas other parameters like localhost are passed on every call to Produce a log message. I'm using TLS for security and to maintain log sequence, so recreating the transport/logger loses time on reconnection latency, and also causes throttling issues with the target log aggregator service.

Here is an example of how I thought this should work:

transport = new winston.transports.Syslog({...})
logger = createLogger({...})
while ... {
    ...
    transport.localhost = ...
    transport.appName = ...
    logger.log(level, message)
}
DABH commented

Looks like we merged the PR that fixes this issue so I'll go ahead and close this issue. Planning on doing an NPM release now.