introduce the logging module
This commit is contained in:
34
src/logging/models/logentry.model.ts
Normal file
34
src/logging/models/logentry.model.ts
Normal file
@@ -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);
|
||||
Reference in New Issue
Block a user