eventlogger
v1.3.2
Published
Cross-platform Event Logger for NodeJS written in pure Javascript.
Downloads
26
Readme
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
- [x] Windows =>
Windows Event Viewer
- [x] MacOSX =>
Console
=>/Library/Logs/<SOURCE>/<SOURCE>.log
- [x] Linux =>
/var/log/<SOURCE>.log
Event Types
- [x]
info
/information
- [x]
warn
/warning
- [x]
error
- [x]
auditSuccess
- [x]
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!')