diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2021-05-03 08:04:53 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2021-05-11 21:49:21 +0200 |
commit | c8144a9c60279f8dc81b2506794acd24df31b9a3 (patch) | |
tree | 495231540cd6f04f02d7d7f22db38f36d716833a /deployment | |
parent | 25a6ef32df15d05904622326328882549095532f (diff) |
Initial checkin: Quarkus Google Cloud JSON Logging.
Change-Id: I264211f56c2bed4002ecdb6ead8a5321ada855fd
Diffstat (limited to 'deployment')
-rw-r--r-- | deployment/pom.xml | 57 | ||||
-rw-r--r-- | deployment/src/main/java/eu/mulk/quarkus/observability/googlecloud/jsonlogging/GoogleCloudLoggingProcessor.java | 23 |
2 files changed, 80 insertions, 0 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>eu.mulk.quarkus-observability</groupId> + <artifactId>quarkus-googlecloud-jsonlogging-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> + </parent> + <artifactId>quarkus-googlecloud-jsonlogging-deployment</artifactId> + <name>Quarkus Google Cloud JSON Logging Extension - Deployment</name> + + <dependencies> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-arc-deployment</artifactId> + </dependency> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-jsonb-deployment</artifactId> + </dependency> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-jsonb-spi</artifactId> + </dependency> + <dependency> + <groupId>eu.mulk.quarkus-observability</groupId> + <artifactId>quarkus-googlecloud-jsonlogging</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-junit5-internal</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> + +</project> 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()); + } +} |