Added custom logger that logs to db

This commit is contained in:
2026-02-04 16:06:49 -05:00
parent 3d8d23ed69
commit 68f43b9bdf
9 changed files with 137 additions and 15 deletions

24
src/logs/logs.entity.ts Normal file
View 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;
}