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

@reallyuseful/logger-transport-gelf

v1.0.0-alpha.2

Published

A logging transport for GELF and Graylog

Downloads

3

Readme

@reallyuseful/logger-transport-gelf

Logging transport for GELF/Graylog

This is a logging transport for @reallyuseful/logger.

It logs to a GELF server (the protocol used by Graylog).

const { Logger, ConsoleTransport } = require('@reallyuseful/logger');
const { GelfTransport } = require('@reallyuseful/logger-transport-gelf');

// log to Graylog and to the console
const gelfTransport = new GelfTransport({ appName: 'myApp' });
const consoleTransport = new ConsoleTransport();

const myLogger = new Logger([gelfTransport, consoleTransport]);

Options for GelfTransport

GelfTransport can be customized with the following options:

Options for connecting to the GELF/Gryalog server

  • host (string): the GELF or Graylog host (default: localhost)
  • port (number): TCP or UDP port number (default: 12201)
  • protocol (udp, tcp, or tcp-tls): whether to use UDP, TCP, or TCP with TLS encryption (default: udp)
  • ipVersion (4 or 6): must be set if your GELF host is on IPv6 (default: 4)
  • tcpTimeout (number): if using a tcp protocol, the timeout in milliseconds (default: 4000 milliseconds)
  • caCert (string): if using tcp-tls and a self-signed certificate, the certificate of the CA that issued it, in PEM format

Options that identify your app

  • source (string): your app’s hostname (default: os.hostname())
  • appName (string): your app’s name, passed as the appName value to GELF
  • appVersion (string): your app’s version number, passed as the appVersion value to GELF
  • env (string): the environment (such as "development" or "production") in which your app is running (default: the value of the NODE_ENV environment variable)

Options for modifying messages to be logged

  • transform (function): an optional function that can modify messages just before they are sent to GELF. Receives (message, meta) as input and must return an object { message, meta } with the modified values.

Other options

  • minimumSeverity (Level): if specified, messages lower than this severity will not be logged to this transport