aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/juick/XMPPManager.java10
-rw-r--r--src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java4
2 files changed, 8 insertions, 6 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"));
diff --git a/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java b/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java
index c0d809c4..d13847ba 100644
--- a/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java
+++ b/src/main/java/rocks/xmpp/core/session/debug/LogbackDebugger.java
@@ -37,12 +37,12 @@ public class LogbackDebugger implements XmppDebugger {
@Override
public void writeStanza(String s, Object o) {
- logger.info("OUT: {}", s);
+ logger.trace("OUT: {}", s);
}
@Override
public void readStanza(String s, Object o) {
- logger.info("IN: {}", s);
+ logger.trace("IN: {}", s);
}
@Override