1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

fix(app/logs): change pattern to detect double serialized JSON logs [EE-4525] (#7962)

* fix(app/logs): change pattern to detect double serialized JSON logs

* fix(app/logs): fallback to raw display when parsing fails + include timestamp for Zerolog logs
This commit is contained in:
LP B 2022-11-04 13:58:18 +01:00 committed by GitHub
parent 9f3d5185b0
commit 6b02d9a1e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 13 deletions

View file

@ -55,6 +55,12 @@ export function formatZerologLogs(rawText: string, withTimestamps?: boolean) {
const text = withTimestamps ? rawText.substring(TIMESTAMP_LENGTH) : rawText;
if (withTimestamps) {
const timestamp = rawText.substring(0, TIMESTAMP_LENGTH);
spans.push({ text: timestamp });
line += `${timestamp} `;
}
const [, date, level, caller, messageAndPairs] =
text.match(ZerologRegex) || [];