Comments (10)
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.
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.
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.
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.
Any further progress on this one? I'd also like to use Bunyan with Loggly.
from node-bunyan.
Well, someone's tried it: https://github.com/smebberson/bunyan-loggly
from node-bunyan.
Cool, thanks. I'll check it out.
from node-bunyan.
@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.
Should I close this? Hasn't been any real updates on it in a while.
from node-bunyan.
I think so.
from node-bunyan.
Related Issues (20)
- Callable custom context serialized on object creation instead of logging call HOT 3
- Error when using proxy
- Serializer on error and custom fields
- Does bunyan depend on log4j? HOT 2
- Add extra metada into log record HOT 1
- Create SECURITY.md
- Bunyan CLI weirdly suppresses output from node's `readline.prompt()` - `mute-stream` and `read` therefore don't work correctly with bunyan HOT 2
- How do I specify the parent caller as the path to log out when `src` is enabled? HOT 1
- Transform stream/`.pipe` are not working as expected
- Verify high CPU usage on journald HOT 1
- Update version of moment to fix CVE-2022-24785
- How can I get logLevels to show as String values like INFO instead of 30 in the log file ? HOT 1
- Update version of moment to fix GHSA-wc69-rhjr-hc9g (CVE-2022-31129) HOT 8
- `v` always 0 despite bunyan version 1.x released and version 2.x in the making HOT 1
- Inconsistent behaviour on Windows with PowerShell
- provide credentials by passing the username and password parameters for elastic user
- Handle non-function `cause` field in error serializer HOT 3
- Bunyan fails to log 'src' when running in Node 20 versus Node 18
- Change time zone to local time in createLogger
- Next.js middleware runtime not supported HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-bunyan.