splunkify

1.0.1 • Public • Published

splunkify - Log utility for creating Splunk friendly logs

Usage:

const {splunkify} = require('splunkify');
 
console.log(splunkify(['info', '/users'], {
    env: 'dev', 
    userId: 1, 
    location: 'Austin,TX'
}))
 
// Will log:
// [info][/users] env=dev userId=1 location=Austin,TX

Or as a logger:

const {Logger} = require('splunkify');
const logger = new Logger(console); // pass your desired logger to constructor
 
logger.info('/users', {
    env: 'dev', 
    userId: 1, 
    location: 'Austin,TX'
});
 
// Will log:
// [info][/users] env=dev userId=1 location=Austin,TX

Readme

Keywords

Package Sidebar

Install

npm i splunkify

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

5.22 kB

Total Files

8

Last publish

Collaborators

  • taylorboren