diff --git a/quarkus43756_smallrye-graphql-client/build.gradle b/quarkus43756_smallrye-graphql-client/build.gradle index 2f52303..9e027d4 100644 --- a/quarkus43756_smallrye-graphql-client/build.gradle +++ b/quarkus43756_smallrye-graphql-client/build.gradle @@ -15,6 +15,7 @@ dependencies { implementation 'org.eclipse:yasson:2.0.4' // should no longer be necessary with version after '2.10.0' see https://github.com/smallrye/smallrye-graphql/pull/2196 implementation 'jakarta.json.bind:jakarta.json.bind-api:3.0.1' //implementation("jakarta.json:jakarta.json-api:2.0.1") + runtimeOnly 'org.jboss.logmanager:jboss-logmanager:3.0.6.Final' testImplementation libs.junit.jupiter testRuntimeOnly 'org.junit.platform:junit-platform-launcher' @@ -34,4 +35,5 @@ tasks.named('test') { application { mainClass = 'run.Client' + applicationDefaultJvmArgs = ['-Djava.util.logging.manager=org.jboss.logmanager.LogManager'] } \ No newline at end of file diff --git a/quarkus43756_smallrye-graphql-client/src/main/java/run/Client.java b/quarkus43756_smallrye-graphql-client/src/main/java/run/Client.java index 6b9c695..0697c70 100644 --- a/quarkus43756_smallrye-graphql-client/src/main/java/run/Client.java +++ b/quarkus43756_smallrye-graphql-client/src/main/java/run/Client.java @@ -2,14 +2,20 @@ import java.util.List; +import org.jboss.logging.Logger; + import io.smallrye.graphql.client.typesafe.api.TypesafeGraphQLClientBuilder; import superheroes.api.SuperheroesClientApi; import superheroes.model.City; import superheroes.model.Superhero; public class Client { + private static final Logger LOGGER = Logger.getLogger(Client.class); + public static void main(String... args) throws Exception { - + LOGGER.info("--- Start ---"); + LOGGER.debug("Timestamp: " + System.currentTimeMillis()); + SuperheroesClientApi api = TypesafeGraphQLClientBuilder.newBuilder().build(SuperheroesClientApi.class); List allCities = api.allCities(); @@ -17,6 +23,7 @@ public static void main(String... args) throws Exception { List allSuperheroes = api.allSuperheroes(); System.out.println("response: " + allSuperheroes); - + + LOGGER.info("--- End ---"); } } \ No newline at end of file diff --git a/quarkus43756_smallrye-graphql-client/src/main/resources/logging.properties b/quarkus43756_smallrye-graphql-client/src/main/resources/logging.properties new file mode 100644 index 0000000..4e80d65 --- /dev/null +++ b/quarkus43756_smallrye-graphql-client/src/main/resources/logging.properties @@ -0,0 +1,20 @@ +# Root logger: +logger.level=INFO +logger.handlers=CONSOLE + +# Additional loggers: +loggers=run,io.smallrye.graphql.client +logger.io.smallrye.graphql.client.level=TRACE +logger.run.level=DEBUG + +# Console handler configuration +handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler +handler.CONSOLE.properties=autoFlush +handler.CONSOLE.level=TRACE +handler.CONSOLE.autoFlush=true +handler.CONSOLE.formatter=PATTERN + +# Console handler configuration +formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter +formatter.PATTERN.properties=pattern +formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %C.%M:%L (%t) %5p %c{1}:%L - %m%n