1.0.16 • Published 5 years ago
otoz-logger v1.0.16
Introduction
A wrapper module around winston specifically written for OTOZ.
Getting Started
- first install the package
npm i otoz-logger
- Import it in your application
import { Logger } from 'otoz-logger'
- Create logger instance
const myLogger = new Logger();
- Set the following environment variables
LOGGER_STRATEGY=winston
LOGGER_TRANSPORT=appInsights
APPINSIGHTS_INSTRUMENTATIONKEY=your-application-insights-key
Usage
myLogger.logInfo({
name: 'serverStarted',
message: 'Express server listening on port ' + PORT,
meta: {
corelationId: 'abc-corelationId',
sessionId: 'abc-sessionId',
requestId: 'abc-requestId',
}
});