davsclaus commented on code in PR #26526:
URL: https://github.com/apache/camel/pull/26526#discussion_r4033568782


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -2251,6 +2343,27 @@ protected int runSpringBoot() throws Exception {
         return p.waitFor();
     }
 
+    /**
+     * The JVM arguments ({@code spring-boot.run.jvmArguments}) an existing 
Spring Boot project is run with: logging to
+     * file, the profile, the port and properties, the flight recording and 
{@code --jvm-args}.
+     */
+    List<String> buildExistingSpringBootJvmArgs() {
+        List<String> args = new ArrayList<>();
+        args.add("-Dlogging.config=classpath:logback-camel-jbang.xml");
+        if (profile != null && !"prod".equals(profile)) {
+            args.add("-Dcamel.main.profile=" + profile);
+        }
+        args.addAll(buildExistingProjectSystemProperties("server.port"));

Review Comment:
   Thanks for the careful read — the Spring Boot path does not need 
`camel.main.name`, though, because it does not use the name-based lookup at all.
   
   `logback-camel-jbang.xml` writes `~/.camel/<PID>.log`, and both readers try 
`<pid>.log` **first** and only fall back to `<name>.log` when it is absent: 
`CamelLogAction.logFile()` 
(`camel-jbang-core/.../action/CamelLogAction.java:450-459`) and the TUI's 
`CamelMonitor` (`:2900-2906`). The `<name>.log` convention exists only for 
Quarkus and Camel Main, whose logging is configured before the process id is 
known. Spring Boot's pid-based file is the primary path the CLI has always used 
(the export Spring Boot path does not set `camel.main.name` either), so adding 
it here would be dead weight.
   
   What was wrong is my wording: the PR description and the tips page said 
`<name>.log` for all three runtimes. Fixed in cf5bb1f9b809 to say `<pid>.log` 
for Spring Boot and `<name>.log` for Quarkus and Camel Main, and the 
description is updated.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to