File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
apps/dokploy/components/dashboard/docker/logs Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export function parseLogs(logString: string): LogLine[] {
4949 // { timestamp: new Date("2024-12-10T10:00:00.000Z"),
5050 // message: "The server is running on port 8080" }
5151 const logRegex =
52- / ^ (?: ( \d + ) \s + ) ? ( \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 } U T C ) ? \s * ( . * ) $ / ;
52+ / ^ (?: (?< lineNumber > \d + ) \s + ) ? (?< timestamp > (?: \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 } U T C ) ) ? \s * (?< message > [ \s \S ] * ) $ / ;
5353
5454 return logString
5555 . split ( "\n" )
@@ -59,7 +59,7 @@ export function parseLogs(logString: string): LogLine[] {
5959 const match = line . match ( logRegex ) ;
6060 if ( ! match ) return null ;
6161
62- const [ , , timestamp , message ] = match ;
62+ const { timestamp, message } = match . groups ?? { } ;
6363
6464 if ( ! message ?. trim ( ) ) return null ;
6565
You can’t perform that action at this time.
0 commit comments