# Changing the Quarkus loggers level from Unleash

DevFeed: [Changing the Quarkus loggers level from Unleash](<https://devfeed.tech/articles/changing-the-quarkus-loggers-level-from-unleash-43593.md>)

Original publisher: [Read original article](<https://quarkus.io/blog/changing-loggers-level-from-unleash/>)

Author: Gwenneg Lepage

Published: 2024-04-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Quarkus - Supersonic Subatomic Java](<https://devfeed.tech/sources/quarkus-supersonic-subatomic-java.md>)

Topics: [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Java](<https://devfeed.tech/topics/java.md>), [Jackson](<https://devfeed.tech/topics/jackson.md>)

Tags: [blog-post](<https://devfeed.tech/tags/blog-post.md>), [code](<https://devfeed.tech/tags/code.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [guide](<https://devfeed.tech/tags/guide.md>), [java](<https://devfeed.tech/tags/java.md>), [logging](<https://devfeed.tech/tags/logging.md>), [openshift](<https://devfeed.tech/tags/openshift.md>), [quarkus](<https://devfeed.tech/tags/quarkus.md>)

## AI overview

A tutorial showing how to change Quarkus logger levels at runtime using Unleash feature-toggle variants, Java logging APIs, JSON payloads, and scheduled configuration updates in containerized OpenShift applications.

## Source excerpt

Introduction I'm part of a Red Hat team that is responsible for a dozen of Quarkus apps which run in Red Hat OpenShift, with multiple pods each. While these apps all have different purposes, they also share a common fate: something will go wrong eventually. When it does, we'll need to understand and fix the problem as fast as possible. Lowering the level of a logger is often helpful, but our apps are containerized and updating an environment variable to change the logger level isn't always as easy at it sounds. We also don't want to expose REST endpoints in most of our apps, so extensions such as quarkus-logging-manager are not an option. Our apps have another thing in common: they depend on quarkus-unleash because we're fetching our feature toggles from Unleash. When I read Zero downtime log level changes using Unleash from Aman Jain, it made me want to try the same thing with Quarkus. I'll show you below how I successfully did that. This blog post contains incremental code snippets. Each one of them is an enhanced version of the previous one and addresses a specific technical challenge. Changing a logger level programmatically Let's start with the obvious requirement: how to change the level of a logger programmatically with Quarkus. As described in the Logging configuration guide, Quarkus supports multiple logging APIs. I only tested the following code with the JBoss Logging API as well as the io.quarkus.logging.Log API. I can't guarantee that everything will work out of the box with other logging APIs. The JBoss Logging API doesn't offer a way to change the level of a logger programmatically, so we need the help of the java.util.logging API to do it: import java.util.logging.Level; (1) import java.util.logging.Logger; (1) public class LogLevelManager { public void setLoggerLevel(String loggerName, String levelName) { Logger logger = Logger.getLogger(loggerName); (2) Level level = Level.parse(levelName); (3) logger.setLevel(level); } } 1 Make sure you're importin