npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ceo-logger

v1.2.1

Published

Auto configuring Winston logger supporting logentries, loggly, mongo, riak, simpledb, syslog and defaulting to console

Downloads

12

Readme

ceo-logger

Auto configuring Winston logger supporting logentries, loggly, mongo, riak, simpledb, syslog and defaulting to console

Install

npm i ceo-logger --save

Basic Usage

basic.js example, defaults to console

var log = new require('ceo-logger')();
log.info('OK') // info: OK

Pass Meta Data

var log = new require('ceo-logger')({ some:"metadata" });
log.info('OK') // info: OK some=metadata

Output Json Data

var log = new require('ceo-logger')({ some:"metadata" }, true);
log.info(logging) // { "some": "metadata", "level": "info", "message": "OK" }

Set Logging Level

var log = new require('ceo-logger')({ some:"metadata" }, true, 'debug'); // default is 'info'
log.debug(logging) // { "some": "metadata", "level": "info", "message": "OK" }

CLI Usage

node basic.js --logentries LogEntriesKey
# logging goes to LogEntries

or via environment variable

logentries=LogEntriesKey

node basic.js
# logging goes to LogEntries

Send to multiple places

logentries=LogEntriesKey
loggly=LogglyKey
mongo=MongoConnectString

node basic.js
# logging goes to LogEntries, Loggly and MongoDb

or config as JSON

node basic.js --ceo-logger '{"logentries":"key", "loggly":"key", "mongo":"connectionString"}'
# logging goes to LogEntries, Loggly and MongoDb

or config as JSONIC

node basic.js --ceo-logger 'logentries:key,loggly:key'
# logging goes to LogEntries and Loggly

Log Functions and Alias

In order to maximize compatibility the following are supported

log.debug   = winston.debug(message)
log.info    = winston.info(message)
log.notice  = winston.notice(message)
log.warning = winston.warning(message)
log.err     = winston.err(message)
log.crit    = winston.crit(message)
log.alert   = winston.alert(message)
log.emerg   = winston.emerg(message)

// matching aliases
log.information = winston.info(message) // informational message
log.warn        = winston.warning(message) // warning conditions
log.error       = winston.err(message) // error conditions
log.critical    = winston.crit(message) // critical conditions
log.emergency   = winston.emerg(message) // system is unusable

// remapped alternatives
log.trace   = winston.debug(message) // debug-level message
log.silly   = winston.debug(message) // debug-level message
log.verbose = winston.info(message) // informational message

License MIT