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)

cusax-fix
Emil Ivov 16 years ago
parent 9cbfa45870
commit 2ec0ce7660

@ -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).

@ -495,7 +495,9 @@ public void publishPresenceStatus(
String oldMessage = this.statusMessage;
this.statusMessage = statusMsg;
if (this.presenceEnabled == false)
if (this.presenceEnabled == false
|| parentProvider.getRegistrarConnection()
instanceof SipRegistrarlessConnection)//no registrar-no publish
{
return;
}

@ -69,7 +69,9 @@ public int getLineCount()
*/
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 void closeLogFile() {}
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 void logMessage(SIPMessage message, String from, String to,
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 void logMessage(SIPMessage message, String from, String to,
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);
}
/**

@ -301,6 +301,8 @@ private void handleUri(String uri)
/**
* 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 @@ private void handleDebugArg(String arg)
rootLogger.addHandler(conHan);
}
conHan.setLevel(Level.FINEST);
//conHan.setLevel(Level.SEVERE);
}
/**

Loading…
Cancel
Save