Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix(postgres): debug client
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazmi35 authored Feb 20, 2024
1 parent a9d5448 commit c69f842
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion services/kanao-gateway/src/Structures/KanaoGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export class NezuGateway extends EventEmitter {
public rest = new REST({ api: proxy, rejectOnRateLimit: proxy === "https://discord.com/api" ? null : () => false });
public logger = createLogger("kanao-gateway", clientId, storeLogs, lokiHost);

public drizzle = drizzle(postgres(databaseUrl), { schema });
public drizzle = drizzle(postgres(databaseUrl, {
debug: (connection, query, parameters, paramTypes) => {
this.logger.debug({ connection, query, parameters, paramTypes }, "POSTGRES_DEBUG:");
}
}), { schema });

public prometheus = new APM({
PORT: prometheusPort,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ import { createLogger } from "../Logger.js";
import { ProcessContextFetchingStrategy } from "./ProcessContextFetchingStrategy.js";

export class ProcessBootstrapper {
public drizzle = drizzle(postgres(databaseUrl), { schema });
public drizzle = drizzle(postgres(databaseUrl, {
debug: (connection, query, parameters, paramTypes) => {
this.logger.debug({ connection, query, parameters, paramTypes }, "POSTGRES_DEBUG:");
}
}), { schema });

/**
* The data passed to the child process
Expand Down

0 comments on commit c69f842

Please sign in to comment.