Install LoggerComponent using npm
;
$ [npm install | yarn add] logger
Configure and load LoggerComponent in the application constructor as shown below.
import {LoggerComponent, LoggerComponentOptions, DEFAULT_LOGGER_OPTIONS} from '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);
// ...
}
// ...
}