Added custom logger that logs to db
This commit is contained in:
24
src/logs/logs.entity.ts
Normal file
24
src/logs/logs.entity.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
@Entity({ name: 'logs' })
|
||||
export class Log {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
level: string; // 'log', 'error', 'warn', etc.
|
||||
|
||||
@Column({ type: String })
|
||||
message: string;
|
||||
|
||||
@Column({ type: String, nullable: true })
|
||||
context?: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
timestamp: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user