fix:log修改

This commit is contained in:
2025-11-20 16:33:48 +08:00
parent 15a4fa618f
commit 3234b0c2e9
4 changed files with 14 additions and 23 deletions

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@ apps/backend/dist
.env
.DS_Store
design
apps/frontend/android/capacitor.settings.gradle
apps/frontend/android/app/capacitor.build.gradle

View File

@@ -49,6 +49,17 @@ export function auditLogMiddleware(req: Request, res: Response, next: NextFuncti
res.on('finish', () => {
const duration = Date.now() - start;
const status = res.statusCode;
const url = req.originalUrl || req.url;
const isHealthCheck =
req.method === 'GET' &&
(url === '/api/health' || url === '/health' || url.startsWith('/api/health?') || url.startsWith('/health?'));
// Skip noisy health-check logs unless there is a server error
if (isHealthCheck && status < 500) {
return;
}
let out: unknown = responseBody;
if (typeof out === 'string') {
// Try to avoid logging massive HTML or binary-like outputs

View File

@@ -1,19 +0,0 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
}
if (hasProperty('postBuildExtras')) {
postBuildExtras()
}

View File

@@ -1,3 +0,0 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../../../node_modules/.pnpm/@capacitor+android@7.4.4_@capacitor+core@7.4.4/node_modules/@capacitor/android/capacitor')