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)
}
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
becauseappName
is only passed to the Producer on instantiation whereas other parameters likelocalhost
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: