Coder Social home page Coder Social logo

Comments (10)

mhart avatar mhart commented on August 21, 2024

Thinking about it a bit more - it may make more sense just to pipe the output through something that already does all of this, eg logstash - but I'll leave this issue open in case you guys do wanna consider it.

from node-bunyan.

trentm avatar trentm commented on August 21, 2024

Currently the intention of the bunyan CLI command is to pretty-print, view (and eventually) filter bunyan format log files or streams.... not really as a tool to redirect those log records somewhere (like, say, to loggly).

That said, one thing that would be useful is to extract the code from the bunyan script into a "bunyan-reader" library that could be re-used by other node scripts to easily make a filter like you describe. That's currently on the TODO list: see "bunyan-reader" at https://github.com/trentm/node-bunyan/blob/master/TODO.md.

I'm not opposed to a plugin mechanism for the bunyan CLI (that would allow this).

from node-bunyan.

aseemk avatar aseemk commented on August 21, 2024

This issue seems to be about bunyan CLI, but is there any Loggly integration for the bunyan library? I see it has support for streams, but that's a bit different than making (ideally, batched) HTTP requests. I also see there's https://github.com/mcavage/node-bunyan-syslog and Loggly supports syslog, but syslog is plaintext, while the whole goal of bunyan is JSON logging. =) Thanks in advance!

from node-bunyan.

trentm avatar trentm commented on August 21, 2024

I think node-bunyan-syslog is just logging the serialized JSON as the "plaintext". You can watch the syslog events (bunyan log records) on the other end and pretty-print with the bunyan CLI.

Loggly: a node-bunyan-loggly module would be appreciated. I don't use loggly so am unlikely to write one soon. A custom bunyan stream should make it straightforward to write to Loggly... including buffering bunyan records to make batched HTTP requests to loggly. This shows a quick example of a custom bunyan stream: https://github.com/trentm/node-bunyan-winston/blob/master/restify-winston.js#L18-L74 You could add batching to the .write() method there.

from node-bunyan.

simonexmachina avatar simonexmachina commented on August 21, 2024

Any further progress on this one? I'd also like to use Bunyan with Loggly.

from node-bunyan.

DaAwesomeP avatar DaAwesomeP commented on August 21, 2024

Well, someone's tried it: https://github.com/smebberson/bunyan-loggly

from node-bunyan.

simonexmachina avatar simonexmachina commented on August 21, 2024

Cool, thanks. I'll check it out.

from node-bunyan.

DaAwesomeP avatar DaAwesomeP commented on August 21, 2024

@trentm what is the "correct" way to add handler plugins? I'm looking into bunyan-logstash. However, I noticed that a similar library (bunyan-loggly) integrates itself into bunyan much differently. A real implementation of plugins for streams and documentation would be nice. Either way, between the two libraries, which integration with bunyan would you prefer? Basically, a require directly in the stream name/type or simply a new argument invoking a previously called on library?

from node-bunyan.

mhart avatar mhart commented on August 21, 2024

Should I close this? Hasn't been any real updates on it in a while.

from node-bunyan.

simonexmachina avatar simonexmachina commented on August 21, 2024

I think so.

from node-bunyan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.