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:
parent
9f3d5185b0
commit
6b02d9a1e3
3 changed files with 35 additions and 13 deletions
|
@ -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) || [];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue