npm install outrider
outrider logger is wrapper over bunyan to allow for easy log management inside of projects that consist of several in house libraries. This library makes sure that logs both end up in the right place and are delivered with necessary meta information.
The goal of
outrider is to make logging with a large number of libraries that are being used in many different situations easy. Lets consider a project with the following dependency structure:
firstname.lastname@example.org └─┬ email@example.com └── firstname.lastname@example.org
outrider this project will log out to a file called
foo.log and will name space
email@example.com. There will also be a
foo-error.log file for error level messages. The log file will have all levels of messages (eg trace and higher) and anything info and higher will be logged to stdout.
Lets dig a little deeper, lets say that we now require
foo in a project called
firstname.lastname@example.org └─┬ email@example.com ├ firstname.lastname@example.org └── ...
outrider will log to
main.log with the same name spacing structure as before. Additionally, the log file will differentiate between
bar1.2.0 making it easy to see errant behavior between different versions of libraries.
outrider it is easy to manage log files as your libraries and services grow in complexity.
outrider will only log to a file if there is a main module for the process. If there is no main module (eg a package is included from the node REPL) then
outrider will only log to stdout.
outrider is easy to set up:
// preferred way:var log = ;// orlog = name version;
log variable is just an instance of the bunyan logger, so feel free to use it as you would any bunyan instance.
and now your logs are ready to go!
outrider will look for
process.env.NODE_LOG_LOCATION as a directory to write log files to. If this is not found then
outrider will default to