add logging (#187)

This commit is contained in:
KM Koushik
2025-07-26 20:05:34 +10:00
committed by GitHub
parent 5612d7a3eb
commit 202fbeacb6
24 changed files with 490 additions and 134 deletions

View File

@@ -3,6 +3,7 @@ import { db } from "../db";
import { UnsendApiError } from "./api-error";
import { getTeamAndApiKey } from "../service/api-service";
import { isSelfHosted } from "~/utils/common";
import { logger } from "../logger/log";
/**
* Gets the team from the token. Also will check if the token is valid.
@@ -54,7 +55,9 @@ export const getTeamFromToken = async (c: Context) => {
lastUsed: new Date(),
},
})
.catch(console.error);
.catch((err) =>
logger.error({ err }, "Failed to update lastUsed on API key")
);
return { ...team, apiKeyId: apiKey.id };
};