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

pino-logdna

v3.0.4

Published

Transport pino logs to LogDNA

Downloads

12,936

Readme

pino-logdna

All Contributors

Transport pino logs to LogDNA

Install

npm install --save pino-logdna

Usage

Pino v7+ Transport

This module can be used as a pino transport:

const pino = require('pino')
const transport = pino.transport({
  target: 'pino-logdna',
  options: {
    key // your LogDNA ingestion key
  }
})

const log = pino(transport)

// Logs will now go to LogDNA
log.info('Happy Logging!')

Options

This transport uses @logdna/logger under the hood, and most options are exposed through pino-logdna.

For a full list, please see the createLogger options.

An additional option is supported by pino-logdna:

  • emptyMessage <String> - When logging an object without a message, e.g. log.info({ some: 'data' }), the value of this option will be used for the outgoing message. Default: '<data log>'.

Legacy Transport

Usage as a legacy transport is still supported. The minimal configuration requires only your LogDNA ingestion key:

npm install -g pino-logdna
node ./app.js | pino-logdna --key="YOUR INGESTION KEY"

CLI Options can be supplied to the command:

node ./app.js | pino-logdna --key "YOUR INGESTION KEY" --env staging --tag foo --tag bar

CLI Options

Options for the CLI are the kebab-case equivalent of the @logdna/logger options:

Options:
  -v, --version                   Show version
  -h, --help                      Show usage information
  -m, --message-key [msg]         The field in the `pino` used as the display line in LogDNA
  -e, --empty-message [msg]       String value to use when no "message" property if found

@logdna/logger Options:
      --key                       *REQUIRED* Your ingestion key
  -t, --tag                       Tag to be added to each message; can be supplied multiple times
  -T, --timeout [30000]           Millisecond timeout for each HTTP request
      --app [default]             Arbitrary app name for labeling each message
  -E, --env                       An environment label attached to each message
  -H, --hostname                  Hostname for each HTTP request
      --mac                       MAC address for each HTTP request
      --ip                        IPv4 or IPv6 address for each HTTP request
      --url                       URL of the logging server
      --flush-limit [5000000]     Maximum total line lengths before a flush is forced
      --flush-interval-ms [250]   Mseconds to wait before sending the buffer
      --base-backoff-ms [3000]    Minimum exponential backoff time in milliseconds
      --max-backoff-ms [30000]    Maximum exponential backoff time in milliseconds
      --index-meta [false]        Controls whether meta data for each message is searchable
  -p, --proxy                     The full URL of an http or https proxy to pass through

Contributing

This project is open-sourced, and accepts PRs from the public for bugs or feature enhancements. Please see CONTRIBUTING.md for more information.

Commit Format

The project uses Commitlint and enforces Conventional Commit Standard. Please format your commits based on these guidelines.

An issue must be opened in the repository for any bug, feature, or anything else that will have a PR.

The commit message must reference the issue with an acceptable action tag in the commit footer, e.g. Fixes: #5.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

License

Copyright © LogDNA, released under an MIT license. See the LICENSE file and https://opensource.org/licenses/MIT

Happy Logging!