Merge pull request #1264 from Dokploy/1202-dates-are-not-shown-in-logs

fix: don't cut log
This commit is contained in:
Mauricio Siu 2025-02-01 23:00:45 -06:00 committed by GitHub
commit e1b114a63b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,18 +63,10 @@ export function parseLogs(logString: string): LogLine[] {
if (!message?.trim()) return null;
// Delete other timestamps and keep only the one from --timestamps
const cleanedMessage = message
?.replace(
/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z|\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} UTC/g,
"",
)
.trim();
return {
rawTimestamp: timestamp ?? null,
timestamp: timestamp ? new Date(timestamp.replace(" UTC", "Z")) : null,
message: cleanedMessage,
message: message.trim(),
};
})
.filter((log) => log !== null);