feat: add backend logger matching frontend text format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 10:22:49 +01:00
parent fd4050a49f
commit c6126c13e9
2 changed files with 93 additions and 5 deletions

View File

@@ -13,17 +13,14 @@ import { schema } from "./graphql/index";
import { buildContext } from "./graphql/context";
import { db } from "./db/connection";
import { redis } from "./lib/auth";
import { logger } from "./lib/logger";
const PORT = parseInt(process.env.PORT || "4000");
const UPLOAD_DIR = process.env.UPLOAD_DIR || "/data/uploads";
const CORS_ORIGIN = process.env.CORS_ORIGIN || "http://localhost:3000";
async function main() {
const fastify = Fastify({
logger: {
level: process.env.LOG_LEVEL || "info",
},
});
const fastify = Fastify({ loggerInstance: logger });
await fastify.register(fastifyCookie, {
secret: process.env.COOKIE_SECRET || "change-me-in-production",