1.3.2 • Published 7 years ago

eventlogger v1.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

EventLogger

Build Status Build status npm version Coverage Status MIT licensed ES5

Standard - JavaScript Style Guide

Cross platform Event Logger for NodeJS written in pure ES5 Javascript with zero dependencies.

The Windows Event Logging portion is heavily inspired from node-windows.

Install

$ npm install eventlogger

How to use

const EventLogger = require('eventlogger')
const log = new EventLogger('Hello World')

log.info('Basic information.')
log.warn('Watch out!')
log.error('Something went wrong.')

Operating Systems

Event Types

  • info / information
  • warn / warning
  • error
  • auditSuccess
  • auditFailure

MacOSX

MacOSX uses the Console to capture application information/warning/errors.

darwin-console

Windows

Windows uses the EventViewer to capture application information/warning/errors.

win32-event-viewer

Linux

Linux stores logs via text files to capture application information/warning/errors.

linux-logging

API

EventLogger

EventLogger Constructor

Parameters

  • config (Object | string) Configuration (optional, default {})
    • config.source string Source (optional, default 'NodeJS')
    • config.eventLog string Event Log (optional, default 'APPLICATION')
    • config.logPath string Log Path (optional, default '~/Library/Logs/NodeJS')

Examples

const EventLogger = require('eventlogger')
const log = new EventLogger({
  source: 'Hello World',
  logPath: '~/Library/Logs'
})

warn

Warning

Parameters

Examples

const log = new EventLogger()
log.warn('Watch out!')

info

Information

Parameters

Examples

const log = new EventLogger()
log.info('Basic Information')

error

Error

Parameters

Examples

const log = new EventLogger()
log.error('Something went wrong!')

success

Audit Failure

Parameters

Examples

const log = new EventLogger()
log.success('Tests pass!')
1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago