Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging configuration not recognizing the classes' package #6881

Open
x80486 opened this issue Dec 26, 2024 · 1 comment
Open

Logging configuration not recognizing the classes' package #6881

x80486 opened this issue Dec 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@x80486
Copy link

x80486 commented Dec 26, 2024

Bug description

Description

I'm facing a small problem with the logging output. The current logging configuration is basically this:

quarkus:
  ...
  log:
    category:
      "io.quarkus":
        level: INFO
      "tld.domain
        level: INFO
    console:
      async: true
      enable: true
      format: "%d{yyyy-MM-dd HH:mm:ss,SSS} |- %-5p in %c:%L [%t] - %m%e%n"
      json: false
    level: WARN

With this, I'm expecting that any classes under tld.domain will be logged at INFO level, but the application does not log any output for these classes unless I set log.level to a higher threshold.

Moreover, based on the format that I have, the class names and their packages must be logged, but with Camel only the class name is logged — and I guess that may be the actual issue.

This is the application output when I set log.level to INFO:

__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2024-12-26 23:26:48,519 |- INFO  in org.apache.camel.quarkus.core.CamelBootstrapRecorder:46 [Quarkus Main Thread] - Apache Camel Quarkus 3.17.0 is starting
2024-12-26 23:26:48,520 |- INFO  in org.apache.camel.main.MainSupport:71 [Quarkus Main Thread] - Apache Camel (Main) 4.9.0 is starting
2024-12-26 23:26:48,527 |- INFO  in org.apache.camel.main.ProfileConfigurer:97 [Quarkus Main Thread] - The application is starting with profile: dev
2024-12-26 23:26:48,622 |- INFO  in org.apache.camel.impl.engine.AbstractCamelContext:2524 [Quarkus Main Thread] - Apache Camel 4.9.0 (camel-1) is starting
2024-12-26 23:26:48,626 |- INFO  in org.apache.camel.impl.engine.AbstractCamelContext:2727 [Quarkus Main Thread] - Routes startup (total:1)
2024-12-26 23:26:48,627 |- INFO  in org.apache.camel.impl.engine.AbstractCamelContext:2731 [Quarkus Main Thread] -     Started timer.route (timer://sampleTimer)
2024-12-26 23:26:48,627 |- INFO  in org.apache.camel.impl.engine.AbstractCamelContext:2764 [Quarkus Main Thread] - Apache Camel 4.9.0 (camel-1) started in 4ms (build:0ms init:0ms start:4ms boot:380ms)
2024-12-26 23:26:48,703 |- INFO  in io.quarkus:109 [Quarkus Main Thread] - application 0.0.0-SNAPSHOT on JVM (powered by Quarkus 3.17.4) started in 1.901s. Listening on: http://localhost:8080
2024-12-26 23:26:48,704 |- INFO  in io.quarkus:113 [Quarkus Main Thread] - Profile dev activated. Live Coding activated.
2024-12-26 23:26:48,704 |- INFO  in io.quarkus:115 [Quarkus Main Thread] - Installed features: [camel-core, camel-log, camel-timer, cdi, config-yaml, smallrye-context-propagation, vertx]
2024-12-26 23:26:49,633 |- INFO  in ExampleRouteBuilder:14:166 [Camel (camel-1) thread #1 - timer://sampleTimer] - Checking the gravitational constant in your locale...
2024-12-26 23:26:52,626 |- INFO  in ExampleRouteBuilder:14:166 [Camel (camel-1) thread #1 - timer://sampleTimer] - Checking the gravitational constant in your locale...
q
2024-12-26 23:26:53,681 |- INFO  in org.apache.camel.impl.engine.AbstractCamelContext:2981 [Shutdown thread] - Apache Camel 4.9.0 (camel-1) is shutting down
2024-12-26 23:26:53,689 |- INFO  in org.apache.camel.impl.engine.AbstractCamelContext:166 [Shutdown thread] - Routes stopped (total:1)
2024-12-26 23:26:53,689 |- INFO  in org.apache.camel.impl.engine.AbstractCamelContext:166 [Shutdown thread] -     Stopped timer.route (timer://sampleTimer)
2024-12-26 23:26:53,693 |- INFO  in org.apache.camel.impl.engine.AbstractCamelContext:3112 [Shutdown thread] - Apache Camel 4.9.0 (camel-1) shutdown in 11ms (uptime:5s)
2024-12-26 23:26:53,701 |- INFO  in io.quarkus:124 [Shutdown thread] - application stopped in 0.022s

And what I was mentioning is that these log statements should have the package names: tld.domain.route.ExampleRouteBuilder instead:

2024-12-26 23:26:49,633 |- INFO  in ExampleRouteBuilder:14:166 [Camel (camel-1) thread #1 - timer://sampleTimer] - Checking the gravitational constant in your locale...
2024-12-26 23:26:52,626 |- INFO  in ExampleRouteBuilder:14:166 [Camel (camel-1) thread #1 - timer://sampleTimer] - Checking the gravitational constant in your locale...

By the way, the same logging configuration I use it in almost all other Quarkus applications, that's why I think this may be something with Camel.

@x80486 x80486 added the bug Something isn't working label Dec 26, 2024
@zhfeng
Copy link
Contributor

zhfeng commented Dec 30, 2024

It looks like you are using camel-log and it has a different format, see https://camel.apache.org/components/4.8.x/log-component.html#_full_customization_of_the_logging_output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants