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 --- deployment/pom.xml | 57 ++++++++++++++++++++++ .../jsonlogging/GoogleCloudLoggingProcessor.java | 23 +++++++++ 2 files changed, 80 insertions(+) create mode 100644 deployment/pom.xml create mode 100644 deployment/src/main/java/eu/mulk/quarkus/observability/googlecloud/jsonlogging/GoogleCloudLoggingProcessor.java (limited to 'deployment') diff --git a/deployment/pom.xml b/deployment/pom.xml new file mode 100644 index 0000000..5d34a10 --- /dev/null +++ b/deployment/pom.xml @@ -0,0 +1,57 @@ + + + + 4.0.0 + + + eu.mulk.quarkus-observability + quarkus-googlecloud-jsonlogging-parent + 1.0.0-SNAPSHOT + + quarkus-googlecloud-jsonlogging-deployment + Quarkus Google Cloud JSON Logging Extension - Deployment + + + + io.quarkus + quarkus-arc-deployment + + + io.quarkus + quarkus-jsonb-deployment + + + io.quarkus + quarkus-jsonb-spi + + + eu.mulk.quarkus-observability + quarkus-googlecloud-jsonlogging + ${project.version} + + + io.quarkus + quarkus-junit5-internal + test + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${quarkus.version} + + + + + + + + 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