summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-01-15 16:13:01 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2022-01-15 21:14:23 +0100
commit348f2055bfb000633bb80e89bcf62ea037a5af0b (patch)
tree9ad5b0436a7fc24af466508a552366a1f867c7cb /example
parent93ecfd1e0c1d1e40fb17e580a7a11de35383ef79 (diff)
Add a Spring Boot example and integration code.
Change-Id: Ia11dea607c74d9b4cc9a698e9ec92e930bd03f37
Diffstat (limited to 'example')
-rw-r--r--example/pom.xml44
-rw-r--r--example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RandomNumberParameterProvider.java14
-rw-r--r--example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RootResource.java36
-rw-r--r--example/src/main/resources/META-INF/services/eu.mulk.quarkus.googlecloud.jsonlogging.StructuredParameterProvider1
-rw-r--r--example/src/main/resources/application.properties0
5 files changed, 0 insertions, 95 deletions
diff --git a/example/pom.xml b/example/pom.xml
deleted file mode 100644
index 546a47c..0000000
--- a/example/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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-googlecloud-jsonlogging</groupId>
- <artifactId>quarkus-googlecloud-jsonlogging-parent</artifactId>
- <version>3.1.4-SNAPSHOT</version>
- </parent>
-
- <artifactId>quarkus-googlecloud-jsonlogging-example</artifactId>
- <name>Quarkus Google Cloud JSON Logging Extension - Example</name>
-
- <dependencies>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-resteasy</artifactId>
- </dependency>
- <dependency>
- <groupId>eu.mulk.quarkus-googlecloud-jsonlogging</groupId>
- <artifactId>quarkus-googlecloud-jsonlogging</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RandomNumberParameterProvider.java b/example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RandomNumberParameterProvider.java
deleted file mode 100644
index 7e4158c..0000000
--- a/example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RandomNumberParameterProvider.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package eu.mulk.quarkus.googlecloud.jsonlogging.example;
-
-import eu.mulk.quarkus.googlecloud.jsonlogging.KeyValueParameter;
-import eu.mulk.quarkus.googlecloud.jsonlogging.StructuredParameter;
-import eu.mulk.quarkus.googlecloud.jsonlogging.StructuredParameterProvider;
-import java.util.concurrent.ThreadLocalRandom;
-
-public class RandomNumberParameterProvider implements StructuredParameterProvider {
-
- @Override
- public StructuredParameter getParameter() {
- return KeyValueParameter.of("randomNumber", ThreadLocalRandom.current().nextInt());
- }
-}
diff --git a/example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RootResource.java b/example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RootResource.java
deleted file mode 100644
index 6fa42cd..0000000
--- a/example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RootResource.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package eu.mulk.quarkus.googlecloud.jsonlogging.example;
-
-import eu.mulk.quarkus.googlecloud.jsonlogging.KeyValueParameter;
-import eu.mulk.quarkus.googlecloud.jsonlogging.Label;
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import org.jboss.logging.Logger;
-import org.jboss.logging.MDC;
-
-@Produces("text/plain")
-@Path("/")
-@ApplicationScoped
-public class RootResource {
-
- static final Logger log = Logger.getLogger(RootResource.class);
-
- @PostConstruct
- public void init() {
- log.warn("Hey!");
- }
-
- @GET
- public String hello() {
- MDC.put("requestMethod", "GET");
- log.infof(
- "Hello %s.",
- "Mulkiatsch",
- KeyValueParameter.of("a", "b"),
- Label.of("app", "foo"),
- KeyValueParameter.of("version", 10));
- throw new IllegalStateException();
- }
-}
diff --git a/example/src/main/resources/META-INF/services/eu.mulk.quarkus.googlecloud.jsonlogging.StructuredParameterProvider b/example/src/main/resources/META-INF/services/eu.mulk.quarkus.googlecloud.jsonlogging.StructuredParameterProvider
deleted file mode 100644
index c0017e6..0000000
--- a/example/src/main/resources/META-INF/services/eu.mulk.quarkus.googlecloud.jsonlogging.StructuredParameterProvider
+++ /dev/null
@@ -1 +0,0 @@
-eu.mulk.quarkus.googlecloud.jsonlogging.example.RandomNumberParameterProvider
diff --git a/example/src/main/resources/application.properties b/example/src/main/resources/application.properties
deleted file mode 100644
index e69de29..0000000
--- a/example/src/main/resources/application.properties
+++ /dev/null