1.0.4 • Published 3 years ago
@nestjs-logger/file v1.0.4
NestJS File Logger
Logger for saving into a single file.
Installation
NPM
npm install @nestjs-logger/fileYarn
yarn add @nestjs-logger/fileUsage
import { FileLogger } from '@nestjs-logger/file';
import { resolve } from 'fs';
const app = await NestFactory.create(AppModule, {
logger: FileLogger.create({
directory: resolve(__dirname, '../storage/logs'),
}),
});This will log into ./storage/logs/nest.log outside the dist directory.
NOTE: All the following directories must be already existing.
Options
| Key | Type | Required | Default |
|---|---|---|---|
directory | string | Yes | |
filename | string | No | nest |
extension | string | No | log |