From 93ecfd1e0c1d1e40fb17e580a7a11de35383ef79 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 15 Jan 2022 14:03:41 +0100 Subject: Load providers registered through the ServiceLoader mechanism. Change-Id: I392e78b34c8330e9b4c06d57b1423ca552ba6fc1 --- .../jsonlogging/example/RandomNumberParameterProvider.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RandomNumberParameterProvider.java (limited to 'example/src/main/java') 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 new file mode 100644 index 0000000..7e4158c --- /dev/null +++ b/example/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/example/RandomNumberParameterProvider.java @@ -0,0 +1,14 @@ +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()); + } +} -- cgit v1.2.3