Skip to content

feature request: Environment Flag to Control Koa Request Logs #7282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
0xMurage opened this issue Apr 13, 2025 · 0 comments
Open

feature request: Environment Flag to Control Koa Request Logs #7282

0xMurage opened this issue Apr 13, 2025 · 0 comments
Assignees
Labels
feature-request Something cool or not cool status/planned We decided to do it.

Comments

@0xMurage
Copy link

0xMurage commented Apr 13, 2025

What problem did you meet?

Currently, Logto's Koa middleware logs all incoming HTTP requests. While this can be helpful for debugging and monitoring in some cases, it is noisy in production environments with high traffic.

await koaLogger({
transporter: (string, [, _, requestPath]) => {
// Ignoring static file requests in development since vite will load a crazy amount of files
if (!EnvSet.values.isProduction && path.basename(requestPath).includes('.')) {
return;
}
consoleLog.plain(string);
},
})(ctx, next);

Describe what you'd like Logto to have

I propose introduction of an environment flag (e.g., LOGTO_ENABLE_REQUEST_LOGS) that would allow users to control whether or not these Koa request logs are enabled.

@gao-sun gao-sun added the feature-request Something cool or not cool label Apr 16, 2025
@gao-sun gao-sun added the status/planned We decided to do it. label May 8, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Something cool or not cool status/planned We decided to do it.
Development

No branches or pull requests

3 participants