forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#14326 from galderz/t_inherit_14154_v4
Handle 'inherit' logging min-level settings
- Loading branch information
Showing
7 changed files
with
108 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...c/main/java/io/quarkus/it/logging/minlevel/set/below/child/LoggingMinLevelBelowChild.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.quarkus.it.logging.minlevel.set.below.child; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
import io.quarkus.it.logging.minlevel.set.LoggingWitness; | ||
|
||
@Path("/log/below/child") | ||
public class LoggingMinLevelBelowChild { | ||
|
||
static final Logger LOG = Logger.getLogger(LoggingMinLevelBelowChild.class); | ||
|
||
@GET | ||
@Path("/trace") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public boolean isTrace() { | ||
return LOG.isTraceEnabled() && LoggingWitness.loggedTrace("trace-message", LOG); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
integration-tests/logging-min-level-set/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
quarkus.log.min-level=DEBUG | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.above".min-level=INFO | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.below".min-level=TRACE | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.below.child".min-level=inherit | ||
quarkus.log.category."io.quarkus.it.logging.minlevel.set.promote".min-level=ERROR |
27 changes: 27 additions & 0 deletions
27
...l-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowChildTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.quarkus.it.logging.minlevel.set; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
/** | ||
* Test verifies that a min-level override that goes below the default min-level is applied correctly. | ||
*/ | ||
@QuarkusTest | ||
@QuarkusTestResource(SetRuntimeLogLevels.class) | ||
public class LoggingMinLevelBelowChildTest { | ||
|
||
@Test | ||
public void testTrace() { | ||
given() | ||
.when().get("/log/below/child/trace") | ||
.then() | ||
.statusCode(200) | ||
.body(is("true")); | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...t/src/test/java/io/quarkus/it/logging/minlevel/set/NativeLoggingMinLevelBelowChildIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.quarkus.it.logging.minlevel.set; | ||
|
||
import io.quarkus.test.junit.NativeImageTest; | ||
|
||
@NativeImageTest | ||
public class NativeLoggingMinLevelBelowChildIT extends LoggingMinLevelBelowChildTest { | ||
|
||
// Execute the same tests but in native mode. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters