diff options
author | Vitaly Takmazov | 2023-12-21 17:56:38 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-12-21 17:56:38 +0300 |
commit | e25ec6f291c3b04f6bf492ad5f803bbc379d27eb (patch) | |
tree | 7cde6742ae2ae20512273f6c88deefd9d3b89290 /src/main/java/com | |
parent | 611c2a7d8302b478ddb0eb3d67d7dc2046bed933 (diff) |
Log XMPP traffic at trace level
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/juick/XMPPManager.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/com/juick/XMPPManager.java b/src/main/java/com/juick/XMPPManager.java index d4daf9a4..0c5cb2f4 100644 --- a/src/main/java/com/juick/XMPPManager.java +++ b/src/main/java/com/juick/XMPPManager.java @@ -99,11 +99,13 @@ public class XMPPManager implements NotificationListener { this.messagesService = messagesService; this.userService = userService; logger.info("xmpp component start connecting to {}", componentPort); - XmppSessionConfiguration configuration = XmppSessionConfiguration.builder() + var configurationBuilder = XmppSessionConfiguration.builder() .extensions(Extension.of(com.juick.model.Message.class), Extension.of(MessageQuery.class)) - .debugger(LogbackDebugger.class) - .defaultResponseTimeout(Duration.ofMillis(120000)) - .build(); + .defaultResponseTimeout(Duration.ofMillis(120000)); + if (logger.isTraceEnabled()) { + configurationBuilder.debugger(LogbackDebugger.class); + } + var configuration = configurationBuilder.build(); xmpp = ExternalComponent.create(componentName, password, configuration, componentHost, componentPort); ServiceDiscoveryManager serviceDiscoveryManager = xmpp.getManager(ServiceDiscoveryManager.class); serviceDiscoveryManager.addIdentity(Identity.clientBot().withName("Juick")); |