@bluefinancefinland/logger
v1.0.10
Published
Provides an easy to use wrapper around
Downloads
18
Readme
@bluefinance/logger
Provides an easy to use wrapper around
- bunyan (https://github.com/trentm/node-bunyan)
- bunyan-seq (https://github.com/datalust/bunyan-seq)
- bunyan-debug-stream (https://github.com/benbria/bunyan-debug-stream)
Installation
- npm login --registry http://npm.axon-platform.com
- npm i --save @bluefinance/logger
Usage and configuration in main entrypoint
import log from "@bluefinance/logger";
//
// Call configure in main entry point.
// After configuration, there will be a singleton of the logger
// that can be imported in other files (see example "Usage in other files")
log.configure({
seqUrl: "https://seq.example.com:5341",
appName: "demoapp",
apiKey: "provide-if-given",
});
Usage in other files
import log from "@bluefinance/logger";
class Myclass {
doSomething(sessionId: string) {
log.info({ sessionId }, "Some interesting event with {sessionId}");
}
}