mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-05 05:55:21 +02:00
feat(logging): exclude Dashboard requests from access logs processing
- Updated the log processing functions to filter out requests that start with "/dashboard". - Enhanced the monitoring configuration to also exclude Dashboard requests alongside the Dokploy service app.
This commit is contained in:
@@ -27,6 +27,10 @@ export function processLogs(
|
|||||||
if (log.ServiceName === "dokploy-service-app@file") {
|
if (log.ServiceName === "dokploy-service-app@file") {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// Exclude Dashboard requests - they start with /dashboard
|
||||||
|
if (log.RequestPath?.startsWith("/dashboard")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const date = new Date(log.StartUTC);
|
const date = new Date(log.StartUTC);
|
||||||
|
|
||||||
if (dateRange?.start || dateRange?.end) {
|
if (dateRange?.start || dateRange?.end) {
|
||||||
@@ -97,6 +101,10 @@ export function parseRawConfig(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.compact()
|
.compact()
|
||||||
|
.filter((log) => {
|
||||||
|
// Exclude Dashboard requests - they start with /dashboard
|
||||||
|
return !log.RequestPath?.startsWith("/dashboard");
|
||||||
|
})
|
||||||
.value();
|
.value();
|
||||||
|
|
||||||
// Apply date range filter if provided
|
// Apply date range filter if provided
|
||||||
|
|||||||
@@ -162,7 +162,11 @@ export const readMonitoringConfig = async (readAll = false) => {
|
|||||||
trimmed.endsWith("}")
|
trimmed.endsWith("}")
|
||||||
) {
|
) {
|
||||||
const log = JSON.parse(trimmed);
|
const log = JSON.parse(trimmed);
|
||||||
if (log.ServiceName !== "dokploy-service-app@file") {
|
// Exclude Dokploy service app and Dashboard requests
|
||||||
|
if (
|
||||||
|
log.ServiceName !== "dokploy-service-app@file" &&
|
||||||
|
!log.RequestPath?.startsWith("/dashboard")
|
||||||
|
) {
|
||||||
content += `${line}\n`;
|
content += `${line}\n`;
|
||||||
validCount++;
|
validCount++;
|
||||||
if (validCount >= 500) {
|
if (validCount >= 500) {
|
||||||
|
|||||||
Reference in New Issue
Block a user