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

LogConfig.categories configuration does not work #1195

Closed
starksm64 opened this issue Mar 5, 2019 · 2 comments
Closed

LogConfig.categories configuration does not work #1195

starksm64 opened this issue Mar 5, 2019 · 2 comments
Labels
kind/bug Something isn't working
Milestone

Comments

@starksm64
Copy link
Contributor

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
@starksm64 starksm64 added the kind/bug Something isn't working label Mar 5, 2019
@gsmet
Copy link
Member

gsmet commented Mar 5, 2019

Not sure it's the only issue but you need:

quarkus.log.category."io.quarkus.smallrye.jwt".level=TRACE
quarkus.log.category."io.undertow.req.security".level=TRACE

with double quotes + I think the "und" was for "undertow"

@starksm64
Copy link
Contributor Author

Ah, ok. I just tried that out and it works. I'll make the logging guide more explicit on this and update the example to work.

@cescoffier cescoffier added this to the 0.11.0 milestone Mar 6, 2019
maxandersen pushed a commit to maxandersen/quarkus that referenced this issue Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants