fix:log修改
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,3 +5,5 @@ apps/backend/dist
|
|||||||
.env
|
.env
|
||||||
.DS_Store
|
.DS_Store
|
||||||
design
|
design
|
||||||
|
apps/frontend/android/capacitor.settings.gradle
|
||||||
|
apps/frontend/android/app/capacitor.build.gradle
|
||||||
|
|||||||
@@ -49,6 +49,17 @@ export function auditLogMiddleware(req: Request, res: Response, next: NextFuncti
|
|||||||
res.on('finish', () => {
|
res.on('finish', () => {
|
||||||
const duration = Date.now() - start;
|
const duration = Date.now() - start;
|
||||||
const status = res.statusCode;
|
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;
|
let out: unknown = responseBody;
|
||||||
if (typeof out === 'string') {
|
if (typeof out === 'string') {
|
||||||
// Try to avoid logging massive HTML or binary-like outputs
|
// Try to avoid logging massive HTML or binary-like outputs
|
||||||
|
|||||||
@@ -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()
|
|
||||||
}
|
|
||||||
@@ -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')
|
|
||||||
Reference in New Issue
Block a user