You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by fm...@apache.org on 2026/03/30 09:56:08 UTC
(camel) branch fix/jbang-it-logging-and-java-version created (now 97dafcd1aa25)
This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a change to branch fix/jbang-it-logging-and-java-version
in repository https://gitbox.apache.org/repos/asf/camel.git
at 97dafcd1aa25 Fix camel-jbang logging and jbang java version option
This branch includes the following new commits:
new 97dafcd1aa25 Fix camel-jbang logging and jbang java version option
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(camel) 01/01: Fix camel-jbang logging and jbang java version option
Posted by fm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a commit to branch fix/jbang-it-logging-and-java-version
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 97dafcd1aa2548a85e99ac50148b1dca80e2b1a7
Author: Croway <fe...@gmail.com>
AuthorDate: Mon Mar 30 11:55:51 2026 +0200
Fix camel-jbang logging and jbang java version option
Two fixes for the Camel JBang IT test failures:
1. Add missing file appender to log4j2-no-color.properties. The
no-color logging config lacked the file appender that log4j2.properties
has. Since CAMEL-23226 changed loggingColor to auto-detect based on
environment (EnvironmentHelper.isColorEnabled()), non-TTY environments
like Docker containers now use the no-color config, which wrote logs
only to console and never to ~/.camel/<pid>.log. This caused camel log
to always return empty output, failing 38+ IT tests with timeouts.
2. Fix jbang --java-version option: use --java instead. The
--java-version flag is not recognized by jbang. The correct flag to
set the Java version is --java. This caused failures when running
with --camel-version pointing to older Camel versions.
---
.../java/org/apache/camel/dsl/jbang/core/commands/Run.java | 2 +-
.../src/main/resources/log4j2-no-color.properties | 13 ++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index 04b96872916e..e006634f05f3 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -1490,7 +1490,7 @@ public class Run extends CamelCommand {
}
if (javaVersion != null) {
- jbangArgs.add("--java-version=" + javaVersion);
+ jbangArgs.add("--java=" + javaVersion);
}
if (repositories != null) {
jbangArgs.add("--repos=" + repositories);
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/log4j2-no-color.properties b/dsl/camel-jbang/camel-jbang-core/src/main/resources/log4j2-no-color.properties
index 6dcdec667d34..6d069aaf0abc 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/log4j2-no-color.properties
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/log4j2-no-color.properties
@@ -22,6 +22,17 @@ appender.stdout.layout.type = PatternLayout
# logging style that is similar to spring boot (no color)
appender.stdout.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} %5p %pid --- [%15.15t] %-35.35c : %m%n
+# file logger
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = ${sys:user.home}${sys:file.separator}.camel${sys:file.separator}${sys:pid}.log
+appender.file.createOnDemand = true
+appender.file.append = false
+appender.file.layout.type = PatternLayout
+# logging style that is similar to spring boot (no color)
+appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} %5p %pid --- [%15.15t] %-35.35c : %m%n
+
+# log to console and file
+rootLogger = INFO,out,file
rootLogger.level = INFO
-rootLogger.appenderRef.out.ref = out