1.3.2 • Published 7 years ago
eventlogger v1.3.2
EventLogger
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
- Windows =>
Windows Event Viewer
- MacOSX =>
Console
=>/Library/Logs/<SOURCE>/<SOURCE>.log
- Linux =>
/var/log/<SOURCE>.log
Event Types
info
/information
warn
/warning
error
auditSuccess
auditFailure
MacOSX
MacOSX uses the Console
to capture application information/warning/errors.
Windows
Windows uses the EventViewer
to capture application information/warning/errors.
Linux
Linux stores logs via text files to capture application information/warning/errors.
API
EventLogger
EventLogger Constructor
Parameters
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!')