From c8144a9c60279f8dc81b2506794acd24df31b9a3 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 3 May 2021 08:04:53 +0200 Subject: Initial checkin: Quarkus Google Cloud JSON Logging. Change-Id: I264211f56c2bed4002ecdb6ead8a5321ada855fd --- .../jsonlogging/GoogleCloudLoggingProcessor.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 deployment/src/main/java/eu/mulk/quarkus/observability/googlecloud/jsonlogging/GoogleCloudLoggingProcessor.java (limited to 'deployment/src/main/java/eu') diff --git a/deployment/src/main/java/eu/mulk/quarkus/observability/googlecloud/jsonlogging/GoogleCloudLoggingProcessor.java b/deployment/src/main/java/eu/mulk/quarkus/observability/googlecloud/jsonlogging/GoogleCloudLoggingProcessor.java new file mode 100644 index 0000000..8ecf000 --- /dev/null +++ b/deployment/src/main/java/eu/mulk/quarkus/observability/googlecloud/jsonlogging/GoogleCloudLoggingProcessor.java @@ -0,0 +1,23 @@ +package eu.mulk.quarkus.observability.googlecloud.jsonlogging; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.annotations.ExecutionTime; +import io.quarkus.deployment.annotations.Record; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.LogConsoleFormatBuildItem; + +class GoogleCloudLoggingProcessor { + + private static final String FEATURE = "googlecloud-jsonlogging"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + @BuildStep + @Record(ExecutionTime.RUNTIME_INIT) + LogConsoleFormatBuildItem setUpFormatter(GoogleCloudLoggingRecorder recorder) { + return new LogConsoleFormatBuildItem(recorder.initialize()); + } +} -- cgit v1.2.3