pinojs / pino-gelf

🌲 Convert Pino logs to GELF format and send to Graylog
Apache License 2.0
13 stars 10 forks source link

should allow custom input stream #6

Open knilink opened 4 years ago

knilink commented 4 years ago

https://github.com/pinojs/pino-gelf/blob/9df316ae7f577260a1c553022d91ca04757ee7e8/lib/pino-gelf.js#L10

- pump(process.stdin, split(fastJsonParse), pipe); 
+ pump(opts.inputStream || process.stdin, split(fastJsonParse), pipe); 
knilink commented 4 years ago

solved by

child = spawn('pino-gelf' , ['log', '-h', 'localhost']);
log = pino({...}, child.stdin)

but still feel good to have it

feel free to close the issue if customizing input stream is considered as necessary.