How to configure Logging with Quarkus

Quarkus uses the JBoss Log Manager project as facade for application logging. Therefore, the main configuration options should be familiar to JBoss/WildFly users. Let’s see how to configure most common options.

Quarkus logging in a nutshell

To use Logging with Quarkus you don’t need to include any extra dependency in your project. As a matter of fact, JBoss Log Manager is a transitive dependency that you have in any Quarkus runtime. See this example


import org.jboss.logging.Logger;

public class GreetingResource {
	private static final Logger LOG = Logger.getLogger(GreetingResource.class);
    public String hello() {"Called Hello");
        return "Hello RESTEasy";

When you request the example endpoint, the INFO message will be printed on the Console:

how to log in quarkus

Te default log level is INFO. The following log levels are available:

  • OFF – Turns off logging.
  • FATAL – A critical service failure/complete inability to service requests of any kind.
  • ERROR – A significant disruption in a request or the inability to service a request.
  • WARN – A non-critical service error or problem that may not require immediate correction.
  • INFO – Default. Service lifecycle events or important related very-low-frequency information.
  • DEBUG – Messages that convey extra information regarding lifecycle or non-request-bound events which may be helpful for debugging.
  • TRACE – Messages that convey extra per-request debugging information that may be very high frequency.
  • ALL – Special level for all messages including custom levels.

How to change the default Log Level

The property you need to use is quarkus.log.level. You can set in As an alternative, you can pass it with -Dquarkus.log.level=LEVEL at startup:


In most cases, you won’t need to change the Log Level for all packages available in your application. For example, you can define a log level for a single namespace such as org.jboss.resteasy. Example:


How to change the Log Format and Output

Quarkus inherits from JBoss Log Manager a set of options to customize the format of logging output. You can read the full list of patterns that you can plug in your log format in the Project Documentation. As an example, here is how to define a custom Console log format which prints the Date – Log Level – ClassName- execution Thread- Log message – CR:

quarkus.log.console.format=%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n

The above, results in the following output on the Console:

16:33:48 INFO  [] (executor-thread-0) Called Hello

On the other hand, if you need to produce the Console logs in JSON format, you can set the following property to true:


JSON Logging requires an external dependency in your project:


Now, your Console emits logs in JSON Format:

   "message":"Called Hello",

Finally, to Log on a File, you have to enable the File Log Handler. If you don’t provide a File Path for your logs, Quarkus will write logs in the file quarkus.log. Here is an example configuration:

# Send output to a trace.log file under the /tmp directory

How to Rotate Log files

When logging in a File, you should configure a rotation policy to prevent your log from growing too much. You can do that with the properties quarkus.log.file.rotation.max-file-size and quarkus.log.file.rotation.max-backup-index. The first one will let you define the maximum size of a log before rotating takes place. The latter, the maximum number of backups to keep.


quarkus.log.file.format=%d{HH:mm:ss} %-5p [%c{2.}]] (%t) %s%e%n

Using Log4j with Quarkus

You can use a set of external logging frameworks with Quarkus, such as Apache Commons Logging, Log4j, or SLF4j,

It is important to note, that you mustn’t include the external dependency in your project (e.g. log4j:log4j:1.2.17) but the JBoss Log Manager wrapper for that Logger. For example, to use Log4j with Quarkus you need to include the following dependency:


With the above configuration in place, you can access Log4j Logger and LogManager API:

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class GreetingResource {
	private static final Logger logger = LogManager.getLogger(GreetingResource.class);
    public String hello() {
   "Hello from Log4j2");
        return "Hello RESTEasy";

Log4j configuration not picked up by Quarkus

JBoss LogManager facade allows to intercept Logger and LogManager API calls from log4j packages. However, as we are not supposed to include log4j core API in the project, you cannot use directly log4j configuration. For configuration purposes, you need to use the logging configuration options in