This repository was archived by the owner on Jan 14, 2020. It is now read-only.
Conversation
* Swap out `winston` for `bunyan` * Monkey patch `console` so it always outputs to stderr * Add 'uncaughtException' handler and log exceptions as a fatal event before crashing the application. * Implement custom request logger similar to `connect.logger()`
The way the `console` object is constructed changed between v0.8 and v0.10. In the latest version of node the object is built from a constructor and conveniently has _stdout and _stderr properties which are references to streams which console will treat as stdout and stderr. In v0.8 the console object is a singleton by virtue of the methods being directly exported, and worse, the functions write to process.stdout and process.stderr directly.
And by that I mean I cobbled together a script (bin/messina.js) to shuttle log events off to a Graylog instance (ours happens to be called "loggins"). Note: It's mostly cobbled together by tearing apart the source of bunyan's CLI tool. I'd like to re-write it to be more testable.
* Makefile: `make` now starts the server and pipes stdout through bunyan to get readable logs * readme.md: update with information about the configuration environment variables necessary for bin/messina * [rename] bin/messina.js -> bin/messina
Contributor
Author
Contributor
Author
Contributor
|
cc @jbuck ! |
Contributor
|
Drats, the one big doh is that using Foreman, it adds about 19 characters to the line, and I have not yet found a good combination of cut, passing variables, and getting gelf working. foreman start -f Procfile|cut -c19- | GRAYLOG_HOST="loggins.mofoprod.net" GRAYLOG_PORT=12201 GRAYLOG_FACILITY="gelf" ./bin/messina that works!! Yeah, just not in upstart...yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Fixes #217