diff options
author | Emil Ivov <emcho@jitsi.org> | 2010-04-30 11:36:45 +0000 |
---|---|---|
committer | Emil Ivov <emcho@jitsi.org> | 2010-04-30 11:36:45 +0000 |
commit | 2ec0ce766061497f6a36f7477ed75e7a876006cf (patch) | |
tree | 8362a105a769175c31ef76075e4699fd1673ffd3 | |
parent | 9cbfa458704b5952d23c707b92ddeb6a10a57763 (diff) | |
download | jitsi-2ec0ce766061497f6a36f7477ed75e7a876006cf.zip jitsi-2ec0ce766061497f6a36f7477ed75e7a876006cf.tar.gz jitsi-2ec0ce766061497f6a36f7477ed75e7a876006cf.tar.bz2 |
Applies a new logging policy that should make file logs more readable (sip messages should now be logged only once for example and console output remains limited)
4 files changed, 32 insertions, 33 deletions
diff --git a/resources/install/logging.properties b/resources/install/logging.properties index 4b4e806..68577f5 100644 --- a/resources/install/logging.properties +++ b/resources/install/logging.properties @@ -38,7 +38,7 @@ handlers= net.java.sip.communicator.util.FileHandler, java.util.logging.ConsoleH net.java.sip.communicator.util.FileHandler.limit = 5000000 net.java.sip.communicator.util.FileHandler.count = 3 net.java.sip.communicator.util.FileHandler.formatter = net.java.sip.communicator.util.ScLogFormatter -net.java.sip.communicator.util.FileHandler.level = FINEST +net.java.sip.communicator.util.FileHandler.level = INFO # Limit the message that are printed on the console to FINEST and above (all). diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java index 02d34de..eec0673 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java @@ -495,7 +495,9 @@ public class OperationSetPresenceSipImpl String oldMessage = this.statusMessage; this.statusMessage = statusMsg; - if (this.presenceEnabled == false) + if (this.presenceEnabled == false + || parentProvider.getRegistrarConnection() + instanceof SipRegistrarlessConnection)//no registrar-no publish { return; } diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipLogger.java b/src/net/java/sip/communicator/impl/protocol/sip/SipLogger.java index a62a5a3..edb8728 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/SipLogger.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/SipLogger.java @@ -69,7 +69,9 @@ public class SipLogger */ public void logException(Throwable ex) { - logger.warn("Exception in the JAIN-SIP stack: " + ex, ex); + logger.warn("Exception in the JAIN-SIP stack: " + ex.getMessage()); + logger.info("JAIN-SIP exception stack trace is", ex); + } /** @@ -203,18 +205,15 @@ public class SipLogger public void logMessage(SIPMessage message, String from, String to, boolean sender, long time) { + String msgHeader; + if(sender) - { - logger.trace("JAIN-SIP sent message from \"" + from - + "\"to \"" + to + "\" at " + time + ":\n" - + message); - } + msgHeader = "JAIN-SIP sent a message from=\""; else - { - logger.trace("JAIN-SIP received message from \"" + from - + "\" to \"" + to + "\" at " + time + "\n" - + message); - } + msgHeader = "JAIN-SIP received a message from=\""; + + logger.info( msgHeader + from + "\" to=\"" + to + "\" at=" + time + + ":\n" + message); } /** @@ -230,18 +229,15 @@ public class SipLogger public void logMessage(SIPMessage message, String from, String to, String status, boolean sender, long time) { + String msgHeader; + if(sender) - { - logger.trace("JAIN-SIP sent message from \"" + from - + "\" to \"" + to + "\" at " + time + " (status: " - + status + "):\n" + message); - } + msgHeader = "JAIN-SIP sent a message from=\""; else - { - logger.trace("JAIN-SIP received message from \"" + from - + "\" to \"" + to + "\" at " + time + " (status: " - + status + "):\n" + message); - } + msgHeader = "JAIN-SIP received a message from=\""; + + logger.info(msgHeader + from + "\" to=\"" + to + "\" at " + time + + " (status: " + status + "):\n" + message); } /** @@ -256,17 +252,16 @@ public class SipLogger public void logMessage(SIPMessage message, String from, String to, String status, boolean sender) { + String msgHeader; + if(sender) - { - logger.trace("JAIN-SIP sent message from \"" + from - + "\" to \"" + to + "\" (status: " + status - + "):\n" + message); - } + msgHeader = "JAIN-SIP sent a message from=\""; else - { - logger.trace("JAIN-SIP received message from \"" + from - + "\" to \"" + to + "\" (status: " + status - + "):\n" + message); } + msgHeader = "JAIN-SIP received a message from=\""; + + + logger.info(msgHeader + from + "\" to=\"" + to + "\" (status: " + + status + "):\n" + message); } /** diff --git a/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java b/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java index 74c20e7..694a4c1 100644 --- a/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java +++ b/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java @@ -301,6 +301,8 @@ public class LaunchArgHandler /** * Instructs SIP Communicator to print logging messages to the console. + * + * @param the debug arg which we are not really using in this method. */ private void handleDebugArg(String arg) { @@ -329,7 +331,7 @@ public class LaunchArgHandler rootLogger.addHandler(conHan); } - conHan.setLevel(Level.FINEST); + //conHan.setLevel(Level.SEVERE); } /** |