introduce the logging module

This commit is contained in:
Sven Czarnian
2022-10-22 23:24:18 +02:00
父節點 fced0f7ec5
當前提交 ab623c8cb6
共有 8 個文件被更改,包括 290 次插入0 次删除

查看文件

@@ -0,0 +1,34 @@
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
export type LogEntryDocument = LogEntry & Document;
@Schema()
export class LogEntry {
@Prop({
required: true,
type: String,
})
component: string;
@Prop({
required: true,
enum: ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'],
type: String,
})
level: string;
@Prop({
required: true,
type: String,
})
timestamp: string;
@Prop({
required: true,
type: String,
})
message: string;
}
export const LogEntrySchema = SchemaFactory.createForClass(LogEntry);