Skip to content

Commit

Permalink
Add and configure jboss-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Oct 11, 2024
1 parent 74fc411 commit 7e35761
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 2 additions & 0 deletions quarkus43756_smallrye-graphql-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -34,4 +35,5 @@ tasks.named('test') {

application {
mainClass = 'run.Client'
applicationDefaultJvmArgs = ['-Djava.util.logging.manager=org.jboss.logmanager.LogManager']
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@

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<City> allCities = api.allCities();
System.out.println("response: " + allCities);

List<Superhero> allSuperheroes = api.allSuperheroes();
System.out.println("response: " + allSuperheroes);


LOGGER.info("--- End ---");
}
}
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7e35761

Please sign in to comment.