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

View File

@@ -0,0 +1,15 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddLogEntity1770232943778 implements MigrationInterface {
name = 'AddLogEntity1770232943778';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "logs" ("id" SERIAL NOT NULL, "level" character varying NOT NULL, "message" character varying NOT NULL, "context" character varying, "timestamp" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_fb1b805f2f7795de79fa69340ba" PRIMARY KEY ("id"))`,
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE "logs"`);
}
}