Skip to content

Commit 15ab755

Browse files
Make STDOUT log pattern configurable via WAVE_LOG_STDOUT_PATTERN (#1055)
* Add date to STDOUT log pattern in logback Include month and day in the console appender timestamp so log entries are unambiguous when read across days (e.g. in k8s pod logs). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Make STDOUT log pattern configurable via WAVE_LOG_STDOUT_PATTERN Allows per-deployment override of the Logback STDOUT pattern (e.g. to omit the date prefix when the log collector already timestamps lines). Default pattern is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1a570db commit 15ab755

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

docs/configuration.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,3 +580,15 @@ Configure slow endpoint logging to identify HTTP endpoints that exceed expected
580580

581581
`wave.trace.slow-endpoint.duration` *(optional)*
582582
: Threshold duration for logging slow HTTP endpoints (default: `1m`).
583+
584+
## Logging
585+
586+
Configure the Logback STDOUT log pattern per deployment. Useful when the runtime environment (for example, a log collector) already prefixes each line with a timestamp and you want to omit Wave's own date prefix.
587+
588+
`WAVE_LOG_STDOUT_PATTERN` *(optional, environment variable only)*
589+
: Logback pattern used by the STDOUT appender (default: `%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg >> wt=%X{requestId}%n`).
590+
To omit the date/time prefix, set the variable to a pattern without the leading `%d{...}` token, for example:
591+
592+
```
593+
WAVE_LOG_STDOUT_PATTERN=[%thread] %-5level %logger{36} - %msg >> wt=%X{requestId}%n
594+
```

src/main/resources/logback.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
<configuration>
2020
<property name="WAVE_LOG_ROOT" value="${WAVE_LOG_ROOT:-.}" />
2121
<property name="WAVE_LOG_NAME" value="${WAVE_LOG_NAME:-wave}" />
22+
<property name="WAVE_LOG_STDOUT_PATTERN" value="${WAVE_LOG_STDOUT_PATTERN:-%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg >> wt=%X{requestId}%n}" />
2223

2324
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
2425
<!-- ansi escape mess-up with non-ansi terminal and loggers -->
2526
<withJansi>false</withJansi>
2627
<encoder>
27-
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg >> wt=%X{requestId}%n</pattern>
28+
<pattern>${WAVE_LOG_STDOUT_PATTERN}</pattern>
2829
</encoder>
2930
<!-- <filter class="io.seqera.wave.util.LoggerLevelFilter">-->
3031
<!-- <level>${WAVE_LOG_LEVEL:-INFO}</level>-->

0 commit comments

Comments
 (0)