Skip to content

LogConfig.categories configuration does not work #1195

@starksm64

Description

@starksm64

I am unable to configure logging categories due to being unable to match a category configuration to a leaf in the ConfigDefinition#loadConfiguration(SmallRyeConfig config) method. The issue comes down to this unit test which fails:

package io.quarkus.deployment.configuration;

import org.junit.Assert;
import org.junit.Test;

public class ConfigPatternMapTest {
    @Test
    public void testWildcardMatch() {
        ConfigPatternMap<LeafConfigType> leafPatterns = new ConfigPatternMap<>();
        ObjectConfigType levelType = new ObjectConfigType("level", null, true, "inherit", String.class);
        leafPatterns.addPattern("log.category.{*}.level", levelType);

        LeafConfigType leafType = leafPatterns.match("quarkus.log.category.io.quarkus.smallrye.jwt.level");
        Assert.assertNotNull(leafType);
    }
}

An example logging configuration snippet that sees this problem is the following where neither the io.quarkus.smallrye.jwt or io.undertow.request.security category levels can be set.

quarkus.log.file.enable=true
quarkus.log.file.path=/tmp/trace.log
quarkus.log.file.level=TRACE
quarkus.log.file.format=%d{HH:mm:ss} %-5p [%c{2.}]] (%t) %s%e%n
quarkus.log.category.io.quarkus.smallrye.jwt.level=TRACE
quarkus.log.category.io.und.req.security.level=TRACE

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions