Add some log messages for better debugging

This commit is contained in:
Tobias Eidelpes 2020-11-12 18:07:43 +01:00
parent 2b0b33baea
commit 44738b51dd
2 changed files with 2 additions and 3 deletions

View File

@ -87,12 +87,10 @@ public class DMTPConnection implements Runnable {
String subject = ""; String subject = "";
if (userInput.split("\\s+").length > 1) if (userInput.split("\\s+").length > 1)
subject = userInput.split("\\s+", 2)[1]; subject = userInput.split("\\s+", 2)[1];
logger.info("Setting subject to: " + subject);
msg.setSubject(subject); msg.setSubject(subject);
out.println("ok"); out.println("ok");
} else if ("data".equals(userInput.split("\\s+")[0])) { } else if ("data".equals(userInput.split("\\s+")[0])) {
String data = userInput.split("\\s+", 2)[1]; String data = userInput.split("\\s+", 2)[1];
logger.info("Setting data to: " + data);
msg.setData(data); msg.setData(data);
out.println("ok"); out.println("ok");
} else { } else {
@ -111,6 +109,7 @@ public class DMTPConnection implements Runnable {
} }
private synchronized void storeMessage() throws UnknownRecipientException { private synchronized void storeMessage() throws UnknownRecipientException {
logger.info("Storing message " + msg.toString());
String errorUnknownRecipient = ""; String errorUnknownRecipient = "";
for (Email recipient : this.msg.getTo()) { for (Email recipient : this.msg.getTo()) {
if (this.messageStorage.containsKey(recipient)) { if (this.messageStorage.containsKey(recipient)) {

View File

@ -50,7 +50,7 @@ public class DMTPListener extends Thread {
} }
public void shutdown() { public void shutdown() {
logger.finer("Shutting down DMTPHandler " + this.toString()); logger.finer("Shutting down DMTPListener " + this.toString());
for (DMTPConnection client : clients) { for (DMTPConnection client : clients) {
if (client != null) if (client != null)
client.shutdown(); client.shutdown();