0.0.14 • Published 3 years ago
@rehansf/logger v0.0.14
Loopback Logger
Installation
Install LoggerComponent using npm
;
$ npm install @rehansf/logger
Basic Use
Configure and load LoggerComponent in the application constructor as shown below.
import {LoggerComponent, LoggerComponentOptions, DEFAULT_LOGGER_OPTIONS} from '@rehansf/logger';
// ...
export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
constructor(options: ApplicationConfig = {}) {
const opts: LoggerComponentOptions = DEFAULT_LOGGER_OPTIONS;
this.configure(LoggerComponentBindings.COMPONENT).to(opts);
// Put the configuration options here
});
this.component(LoggerComponent);
// ...
}
// ...
}
How to use it with postgres
Import model in index.ts
and export it.
export * from '@rehansf/logger/dist/models';