-
Notifications
You must be signed in to change notification settings - Fork 35
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 #685 from wabrit/extension-point-for-custom-labels
provide an extension mechanism for adding custom labels to gcp logs
- Loading branch information
Showing
5 changed files
with
87 additions
and
1 deletion.
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
22 changes: 22 additions & 0 deletions
22
...main/java/io/quarkiverse/googlecloudservices/logging/runtime/LogRecordLabelExtractor.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,22 @@ | ||
package io.quarkiverse.googlecloudservices.logging.runtime; | ||
|
||
import java.util.Map; | ||
|
||
import org.jboss.logmanager.ExtLogRecord; | ||
|
||
/** | ||
* Bind an instance of this interface to include additional labels | ||
* in the log record. You should only bind one extractor in the CDI context. | ||
*/ | ||
public interface LogRecordLabelExtractor { | ||
|
||
/** | ||
* Supply additional labels for a log record. | ||
* | ||
* @param record Record for which labels can be supplied, never null | ||
* @return a map of additional label values, may return null or empty but neither | ||
* keys nor values therein should be null | ||
*/ | ||
Map<String, String> getCustomLabels(ExtLogRecord record); | ||
|
||
} |
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