-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow setting a custom logging filter on logging handlers
Resolves: #25981
- Loading branch information
Showing
12 changed files
with
347 additions
and
33 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
23 changes: 23 additions & 0 deletions
23
core/runtime/src/main/java/io/quarkus/logging/LoggingFilter.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,23 @@ | ||
package io.quarkus.logging; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Makes the filter class known to Quarkus by the specified name. | ||
* The filter can then be configured for a handler (like the logging handler using {@code quarkus.log.console.filter}). | ||
* | ||
* This class must ONLY be placed on implementations of {@link java.util.logging.Filter} that are marked as {@code final}. | ||
*/ | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface LoggingFilter { | ||
|
||
/** | ||
* Name with which the filter is referred to in configuration | ||
*/ | ||
String name(); | ||
} |
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
21 changes: 21 additions & 0 deletions
21
core/runtime/src/main/java/io/quarkus/runtime/logging/DiscoveredLogComponents.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,21 @@ | ||
package io.quarkus.runtime.logging; | ||
|
||
import java.util.Collections; | ||
import java.util.Map; | ||
|
||
public class DiscoveredLogComponents { | ||
|
||
private Map<String, String> nameToFilterClass = Collections.emptyMap(); | ||
|
||
public Map<String, String> getNameToFilterClass() { | ||
return nameToFilterClass; | ||
} | ||
|
||
public void setNameToFilterClass(Map<String, String> nameToFilterClass) { | ||
this.nameToFilterClass = nameToFilterClass; | ||
} | ||
|
||
public static DiscoveredLogComponents ofEmpty() { | ||
return new DiscoveredLogComponents(); | ||
} | ||
} |
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
Oops, something went wrong.