You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/09/12 17:07:00 UTC

[jira] [Created] (CAMEL-24699) camel-jbang - camel run on an existing Quarkus or Camel Main project does not write a log file to ~/.camel

Claus Ibsen created CAMEL-24699:
-----------------------------------

             Summary: camel-jbang - camel run on an existing Quarkus or Camel Main project does not write a log file to ~/.camel
                 Key: CAMEL-24699
                 URL: https://issues.apache.org/jira/browse/CAMEL-24699
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen


When {{camel run}} is pointed at an *existing* project folder that has its own {{pom.xml}}, the Quarkus and Camel Main paths do not configure a log file under {{~/.camel}}, so {{camel log}}, the TUI Log tab and the MCP log resource have nothing to read for those processes.

All the export-based runtimes are wired up (verified in {{Run.java}} on main, 2026-09-12):
* {{--runtime=jbang}}: log4j2 in-process to {{~/.camel/<pid>.log}}
* {{--runtime=main}}: {{writeCamelMainRunLogConfig}} writes {{camel-main-run-log4j2.properties}} into the export, logging to {{~/.camel/<name>.log}}
* {{--runtime=spring-boot}}: {{spring-boot-logback.xml}} is copied into the export as {{logback.xml}}, logging to {{~/.camel/<pid>.log}}
* {{--runtime=quarkus}}: {{quarkus.log.file.enabled=true}} and {{quarkus.log.file.path=${user.home}/.camel/<name>.log}} are appended to the exported {{application.properties}} (CAMEL-23831)

The existing-project paths differ:
* {{runExistingSpringBootProject}} copies {{spring-boot-logback.xml}} into the project as {{logback-camel-jbang.xml}} and passes {{-Dlogging.config=classpath:logback-camel-jbang.xml}}, so it works.
* {{runExistingQuarkusProject}} only adds {{camel-quarkus-cli-connector}} (and {{camel-quarkus-jfr}}) to a temporary pom and runs {{quarkus:dev}}. No log file is configured.
* {{runExistingCamelMainProject}} only adds {{camel-cli-connector}} (and {{camel-jfr}}) to a temporary pom and runs {{camel:run}}. No log file is configured.

Both readers ({{CamelLogAction}} and the TUI {{CamelMonitor}}) try {{<pid>.log}} first and fall back to {{<name>.log}}, so either naming works.

Suggested fix: mirror what the export paths already do.
* Quarkus: pass {{-Dquarkus.log.file.enabled=true -Dquarkus.log.file.path=<~/.camel>/<name>.log}} (and the same {{quarkus.log.file.format}} as the export path) through {{-Djvm.args}} or as system properties on the {{quarkus:dev}} invocation, so the project's own {{application.properties}} is not modified.
* Camel Main: pass {{-Dlog4j2.configurationFile=<path>}} pointing at a {{camel-main-run-log4j2.properties}} rendered into a temp location (or the project's target dir) via {{-Dcamel.jvmArgs}}, mirroring {{writeCamelMainRunLogConfig}}. Fall back gracefully if the project uses logback instead of log4j2.
* Clean the temp config up in the existing shutdown hook alongside {{camel-jbang-run-pom.xml}}.

This closes the last gap in "any tool reads the same log": CLI, TUI, MCP and AI agents currently see logs for every {{camel run}} runtime except these two existing-project cases.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)