Commit b10f4fa6 authored by Jay Kline's avatar Jay Kline Committed by jay

Better debugging messages that indicate what class they came from


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9506 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8f1c7a06
......@@ -174,7 +174,7 @@ public class SchemaManager {
}
catch (SQLException sqle2) {
// The database schema must not be installed.
Log.debug("Error verifying server version", sqle2);
Log.debug("SchemaManager: Error verifying server version", sqle2);
}
}
}
......
......@@ -1300,7 +1300,7 @@ public class SessionManager extends BasicModule implements ClusterEventListener
}
public void stop() {
Log.debug("Stopping server");
Log.debug("SessionManager: Stopping server");
// Stop threads that are sending packets to remote servers
OutgoingSessionPromise.getInstance().shutdown();
if (JiveGlobals.getBooleanProperty("shutdownMessage.enabled")) {
......
......@@ -295,7 +295,7 @@ public class JDBCAuthProvider implements AuthProvider {
}
catch (UserNotFoundException unfe) {
try {
Log.debug("Automatically creating new user account for " + username);
Log.debug("JDBCAuthProvider: Automatically creating new user account for " + username);
UserManager.getUserProvider().createUser(username, StringUtils.randomString(8),
null, null);
}
......
......@@ -104,7 +104,7 @@ public class NativeAuthProvider implements AuthProvider {
}
public void debug(String string) {
Log.debug(string);
Log.debug("NativeAuthProvider: "+string);
}
});
}
......
......@@ -99,7 +99,7 @@ public class POP3AuthProvider implements AuthProvider {
port = JiveGlobals.getXMLProperty("pop3.port", useSSL ? 995 : 110);
if (Log.isDebugEnabled()) {
Log.debug("Created new POP3AuthProvider instance, fields:");
Log.debug("POP3AuthProvider: Created new POP3AuthProvider instance, fields:");
Log.debug("\t host: " + host);
Log.debug("\t port: " + port);
Log.debug("\t domain: " + domain);
......@@ -188,7 +188,7 @@ public class POP3AuthProvider implements AuthProvider {
catch (UserNotFoundException unfe) {
String email = username + "@" + (domain!=null?domain:host);
try {
Log.debug("Automatically creating new user account for " + username);
Log.debug("POP3AuthProvider: Automatically creating new user account for " + username);
// Create user; use a random password for better safety in the future.
// Note that we have to go to the user provider directly -- because the
// provider is read-only, UserManager will usually deny access to createUser.
......
......@@ -272,7 +272,7 @@ public class ClusterManager {
// Reset packet router to use to deliver packets to remote cluster nodes
XMPPServer.getInstance().getRoutingTable().setRemotePacketRouter(null);
if (isClusteringStarted()) {
Log.debug("Shutting down clustered cache service.");
Log.debug("ClusterManager: Shutting down clustered cache service.");
CacheFactory.stopClustering();
}
// Reset the session locator to use
......
......@@ -108,7 +108,7 @@ public class InternalComponentManager extends BasicModule implements ComponentMa
throw new ComponentException("Domain (" + subdomain +
") already taken by another component: " + existingComponent);
}
Log.debug("Registering component for domain: " + subdomain);
Log.debug("InternalComponentManager: Registering component for domain: " + subdomain);
// Register that the domain is now taken by the component
components.put(subdomain, component);
......@@ -133,7 +133,7 @@ public class InternalComponentManager extends BasicModule implements ComponentMa
// Send a disco#info request to the new component. If the component provides information
// then it will be added to the list of discoverable server items.
checkDiscoSupport(component, componentJID);
Log.debug("Component registered for domain: " + subdomain);
Log.debug("InternalComponentManager: Component registered for domain: " + subdomain);
}
catch (Exception e) {
// Unregister the componet's domain
......@@ -151,7 +151,7 @@ public class InternalComponentManager extends BasicModule implements ComponentMa
}
public void removeComponent(String subdomain) {
Log.debug("Unregistering component for domain: " + subdomain);
Log.debug("InternalComponentManager: Unregistering component for domain: " + subdomain);
Component component = components.remove(subdomain);
// Remove any info stored with the component being removed
componentInfo.remove(subdomain);
......@@ -179,7 +179,7 @@ public class InternalComponentManager extends BasicModule implements ComponentMa
for (ComponentEventListener listener : listeners) {
listener.componentUnregistered(component, componentJID);
}
Log.debug("Component unregistered for domain: " + subdomain);
Log.debug("InternalComponentManager: Component unregistered for domain: " + subdomain);
}
public void sendPacket(Component component, Packet packet) {
......@@ -315,7 +315,7 @@ public class InternalComponentManager extends BasicModule implements ComponentMa
}
public void debug(String msg) {
Log.debug(msg);
Log.debug("InternalComponentManager: "+msg);
}
public void debug(String msg, Throwable throwable) {
......@@ -323,7 +323,7 @@ public class InternalComponentManager extends BasicModule implements ComponentMa
}
public void debug(Throwable throwable) {
Log.debug(throwable);
Log.debug("InternalComponentManager: ",throwable);
}
};
}
......
......@@ -248,7 +248,7 @@ public class PluginManager {
if (XMPPServer.getInstance().isSetupMode() && !(pluginDir.getName().equals("admin"))) {
return;
}
Log.debug("Loading plugin " + pluginDir.getName());
Log.debug("PluginManager: Loading plugin " + pluginDir.getName());
Plugin plugin;
try {
File pluginConfig = new File(pluginDir, "plugin.xml");
......@@ -546,7 +546,7 @@ public class PluginManager {
* @param pluginName the name of the plugin to unload.
*/
public void unloadPlugin(String pluginName) {
Log.debug("Unloading plugin " + pluginName);
Log.debug("PluginManager: Unloading plugin " + pluginName);
Plugin plugin = plugins.get(pluginName);
if (plugin != null) {
......@@ -556,7 +556,7 @@ public class PluginManager {
// See if any child plugins are defined.
if (parentPluginMap.containsKey(plugin)) {
for (String childPlugin : parentPluginMap.get(plugin)) {
Log.debug("Unloading child plugin: " + childPlugin);
Log.debug("PluginManager: Unloading child plugin: " + childPlugin);
unloadPlugin(childPlugin);
}
parentPluginMap.remove(plugin);
......@@ -1041,7 +1041,7 @@ public class PluginManager {
dir.mkdir();
// Set the date of the JAR file to the newly created folder
dir.setLastModified(file.lastModified());
Log.debug("Extracting plugin: " + pluginName);
Log.debug("PluginManager: Extracting plugin: " + pluginName);
for (Enumeration e = zipFile.entries(); e.hasMoreElements();) {
JarEntry entry = (JarEntry)e.nextElement();
File entryFile = new File(dir, entry.getName());
......@@ -1154,7 +1154,7 @@ public class PluginManager {
for (String file : children) {
boolean success = deleteDir(new File(dir, file));
if (!success) {
Log.debug("Plugin removal: could not delete: " + new File(dir, file));
Log.debug("PluginManager: Plugin removal: could not delete: " + new File(dir, file));
return false;
}
}
......
......@@ -77,7 +77,7 @@ public class LdapAuthorizationMapping implements AuthorizationMapping {
String username = principal;
DirContext ctx = null;
try {
Log.debug("Starting LDAP search...");
Log.debug("LdapAuthorizationMapping: Starting LDAP search...");
String usernameField = manager.getUsernameField();
String baseDN = manager.getBaseDN();
boolean subTreeSearch = manager.isSubTreeSearch();
......@@ -95,9 +95,9 @@ public class LdapAuthorizationMapping implements AuthorizationMapping {
NamingEnumeration answer = ctx.search("", princSearchFilter, new String[] {principal},
constraints);
Log.debug("... search finished");
Log.debug("LdapAuthorizationMapping: ... search finished");
if (answer == null || !answer.hasMoreElements()) {
Log.debug("Username based on principal '" + principal + "' not found.");
Log.debug("LdapAuthorizationMapping: Username based on principal '" + principal + "' not found.");
return principal;
}
Attributes atrs = ((SearchResult)answer.next()).getAttributes();
......
......@@ -152,7 +152,7 @@ public class LdapGroupProvider implements GroupProvider {
public int getGroupCount() {
if (manager.isDebugEnabled()) {
Log.debug("Trying to get the number of groups in the system.");
Log.debug("LdapGroupProvider: Trying to get the number of groups in the system.");
}
int count = 0;
......@@ -602,7 +602,7 @@ public class LdapGroupProvider implements GroupProvider {
*/
private Collection<Group> populateGroups(Enumeration<SearchResult> answer) throws NamingException {
if (manager.isDebugEnabled()) {
Log.debug("Starting to populate groups with users.");
Log.debug("LdapGroupProvider: Starting to populate groups with users.");
}
DirContext ctx = null;
try {
......@@ -714,7 +714,7 @@ public class LdapGroupProvider implements GroupProvider {
// the user didn't pass the search filter that's defined.
// So, we want to simply ignore the user as a group member.
if (manager.isDebugEnabled()) {
Log.debug("User not found: " + username);
Log.debug("LdapGroupProvider: User not found: " + username);
}
}
}
......@@ -722,7 +722,7 @@ public class LdapGroupProvider implements GroupProvider {
ne.close();
}
if (manager.isDebugEnabled()) {
Log.debug("Adding group \"" + name + "\" with " + members.size() +
Log.debug("LdapGroupProvider: Adding group \"" + name + "\" with " + members.size() +
" members.");
}
Collection<JID> admins = Collections.emptyList();
......@@ -732,12 +732,12 @@ public class LdapGroupProvider implements GroupProvider {
catch (Exception e) {
e.printStackTrace();
if (manager.isDebugEnabled()) {
Log.debug("Error while populating group, " + name + ".", e);
Log.debug("LdapGroupProvider: Error while populating group, " + name + ".", e);
}
}
}
if (manager.isDebugEnabled()) {
Log.debug("Finished populating group(s) with users.");
Log.debug("LdapGroupProvider: Finished populating group(s) with users.");
}
return groups.values();
......
......@@ -326,7 +326,7 @@ public class LdapManager {
buf.append("\t groupSearchFilter: ").append(groupSearchFilter).append("\n");
if (Log.isDebugEnabled()) {
Log.debug(buf.toString());
Log.debug("LdapManager: "+buf.toString());
}
if (ldapDebugEnabled) {
System.err.println(buf.toString());
......@@ -367,7 +367,7 @@ public class LdapManager {
public LdapContext getContext(String baseDN) throws NamingException {
boolean debug = Log.isDebugEnabled();
if (debug) {
Log.debug("Creating a DirContext in LdapManager.getContext()...");
Log.debug("LdapManager: Creating a DirContext in LdapManager.getContext()...");
}
// Set up the environment for creating the initial context
......@@ -404,12 +404,12 @@ public class LdapManager {
}
if (debug) {
Log.debug("Created hashtable with context values, attempting to create context...");
Log.debug("LdapManager: Created hashtable with context values, attempting to create context...");
}
// Create new initial context
LdapContext context = new InitialLdapContext(env, null);
if (debug) {
Log.debug("... context created successfully, returning.");
Log.debug("LdapManager: ... context created successfully, returning.");
}
return context;
}
......@@ -425,7 +425,7 @@ public class LdapManager {
public boolean checkAuthentication(String userDN, String password) {
boolean debug = Log.isDebugEnabled();
if (debug) {
Log.debug("In LdapManager.checkAuthentication(userDN, password), userDN is: " + userDN + "...");
Log.debug("LdapManager: In LdapManager.checkAuthentication(userDN, password), userDN is: " + userDN + "...");
}
DirContext ctx = null;
......@@ -458,11 +458,11 @@ public class LdapManager {
}
if (debug) {
Log.debug("Created context values, attempting to create context...");
Log.debug("LdapManager: Created context values, attempting to create context...");
}
ctx = new InitialDirContext(env);
if (debug) {
Log.debug("... context created successfully, returning.");
Log.debug("LdapManager: ... context created successfully, returning.");
}
}
catch (NamingException ne) {
......@@ -501,20 +501,20 @@ public class LdapManager {
env.put(Context.REFERRAL, "follow");
}
if (debug) {
Log.debug("Created context values, attempting to create context...");
Log.debug("LdapManager: Created context values, attempting to create context...");
}
ctx = new InitialDirContext(env);
}
catch (NamingException e) {
if (debug) {
Log.debug("Caught a naming exception when creating InitialContext", ne);
Log.debug("LdapManager: Caught a naming exception when creating InitialContext", ne);
}
return false;
}
}
else {
if (debug) {
Log.debug("Caught a naming exception when creating InitialContext", ne);
Log.debug("LdapManager: Caught a naming exception when creating InitialContext", ne);
}
return false;
}
......@@ -600,14 +600,14 @@ public class LdapManager {
//Support for usernameSuffix
username = username + usernameSuffix;
if (debug) {
Log.debug("Trying to find a user's DN based on their username. " + usernameField + ": " + username
Log.debug("LdapManager: Trying to find a user's DN based on their username. " + usernameField + ": " + username
+ ", Base DN: " + baseDN + "...");
}
DirContext ctx = null;
try {
ctx = getContext(baseDN);
if (debug) {
Log.debug("Starting LDAP search...");
Log.debug("LdapManager: Starting LDAP search...");
}
// Search for the dn based on the username.
SearchControls constraints = new SearchControls();
......@@ -625,12 +625,12 @@ public class LdapManager {
constraints);
if (debug) {
Log.debug("... search finished");
Log.debug("LdapManager: ... search finished");
}
if (answer == null || !answer.hasMoreElements()) {
if (debug) {
Log.debug("User DN based on username '" + username + "' not found.");
Log.debug("LdapManager: User DN based on username '" + username + "' not found.");
}
throw new UserNotFoundException("Username " + username + " not found");
}
......@@ -642,7 +642,7 @@ public class LdapManager {
// The baseDN must be set correctly so that this doesn't happen.
if (answer.hasMoreElements()) {
if (debug) {
Log.debug("Search for userDN based on username '" + username + "' found multiple " +
Log.debug("LdapManager: Search for userDN based on username '" + username + "' found multiple " +
"responses, throwing exception.");
}
throw new UserNotFoundException("LDAP username lookup for " + username +
......@@ -671,7 +671,7 @@ public class LdapManager {
}
catch (Exception e) {
if (debug) {
Log.debug("Exception thrown when searching for userDN based on username '" + username + "'", e);
Log.debug("LdapManager: Exception thrown when searching for userDN based on username '" + username + "'", e);
}
throw e;
}
......
......@@ -111,7 +111,7 @@ public class LdapVCardProvider implements VCardProvider, PropertyEventListener {
private void initTemplate() {
String property = JiveGlobals.getXMLProperty("ldap.vcard-mapping");
Log.debug("Found vcard mapping: '" + property);
Log.debug("LdapVCardProvider: Found vcard mapping: '" + property);
try {
// Remove CDATA wrapping element
if (property.startsWith("<![CDATA[")) {
......@@ -124,7 +124,7 @@ public class LdapVCardProvider implements VCardProvider, PropertyEventListener {
Log.error("Error loading vcard mapping: " + e.getMessage());
}
Log.debug("attributes size==" + template.getAttributes().length);
Log.debug("LdapVCardProvider: attributes size==" + template.getAttributes().length);
}
private Map<String, String> getLdapAttributes(String username) {
......@@ -143,7 +143,7 @@ public class LdapVCardProvider implements VCardProvider, PropertyEventListener {
javax.naming.directory.Attribute attr = attrs.get(attribute);
String value;
if (attr == null) {
Log.debug("No ldap value found for attribute '" + attribute + "'");
Log.debug("LdapVCardProvider: No ldap value found for attribute '" + attribute + "'");
value = "";
}
else {
......@@ -154,7 +154,7 @@ public class LdapVCardProvider implements VCardProvider, PropertyEventListener {
value = Base64.encodeBytes((byte[])ob);
}
}
Log.debug("Ldap attribute '" + attribute + "'=>'" + value + "'");
Log.debug("LdapVCardProvider: Ldap attribute '" + attribute + "'=>'" + value + "'");
map.put(attribute, value);
}
return map;
......@@ -179,9 +179,9 @@ public class LdapVCardProvider implements VCardProvider, PropertyEventListener {
// Un-escape username.
username = JID.unescapeNode(username);
Map<String, String> map = getLdapAttributes(username);
Log.debug("Getting mapped vcard for " + username);
Log.debug("LdapVCardProvider: Getting mapped vcard for " + username);
Element vcard = new VCard(template).getVCard(map);
Log.debug("Returning vcard");
Log.debug("LdapVCardProvider: Returning vcard");
return vcard;
}
......
......@@ -158,7 +158,7 @@ public class MediaProxy implements SessionListener {
MediaProxySession proxySession = sessions.get(sid);
if (proxySession != null) {
if (Log.isDebugEnabled()) {
Log.debug("SID: " + sid + " agentSID: " + proxySession.getSID());
Log.debug("MediaProxy: SID: " + sid + " agentSID: " + proxySession.getSID());
return proxySession;
}
}
......@@ -174,7 +174,7 @@ public class MediaProxy implements SessionListener {
public void sessionClosed(MediaProxySession session) {
sessions.remove(session.getSID());
if (Log.isDebugEnabled()) {
Log.debug("Session: " + session.getSID() + " removed.");
Log.debug("MediaProxy: Session: " + session.getSID() + " removed.");
}
}
......
......@@ -159,7 +159,7 @@ public class MediaProxyService extends BasicModule
childElementCopy.remove(candidateElement);
Element candidate = childElementCopy.addElement("candidate ");
ProxyCandidate proxyCandidate = mediaProxy.addRelayAgent(sid, iq.getFrom().toString());
Log.debug(sid);
Log.debug("MediaProxyService: "+sid);
proxyCandidate.start();
candidate.addAttribute("name", "voicechannel");
candidate.addAttribute("ip", mediaProxy.getPublicIP());
......@@ -171,7 +171,7 @@ public class MediaProxyService extends BasicModule
candidateElement = childElementCopy.element("relay");
if (candidateElement != null) {
MediaProxySession session = mediaProxy.getSession(sid);
Log.debug(sid);
Log.debug("MediaProxyService: "+sid);
if (session != null) {
Attribute pass = candidateElement.attribute("pass");
......@@ -225,7 +225,7 @@ public class MediaProxyService extends BasicModule
try {
if (Log.isDebugEnabled()) {
Log.debug("RETURNED:" + reply.toXML());
Log.debug("MediaProxyService: RETURNED:" + reply.toXML());
}
router.route(reply);
}
......
......@@ -91,7 +91,7 @@ public abstract class MediaProxySession extends Thread implements ProxyCandidate
this.socketB = new DatagramSocket(localPortB, this.localAddress);
this.socketBControl = new DatagramSocket(localPortB + 1, this.localAddress);
if (Log.isDebugEnabled()) {
Log.debug("Session Created at: A " + localPortA + " : B " + localPortB);
Log.debug("MediaProxySession: Session Created at: A " + localPortA + " : B " + localPortB);
}
}
catch (Exception e) {
......@@ -259,7 +259,7 @@ public abstract class MediaProxySession extends Thread implements ProxyCandidate
dispatchAgentStopped();
Log.debug("Session Stopped");
Log.debug("MediaProxySession: Session Stopped");
}
/**
......@@ -296,7 +296,7 @@ public abstract class MediaProxySession extends Thread implements ProxyCandidate
*/
public void setPortA(int portA) {
if (Log.isDebugEnabled()) {
Log.debug("PORT CHANGED(A):" + portA);
Log.debug("MediaProxySession: PORT CHANGED(A):" + portA);
}
this.portA = portA;
}
......@@ -308,7 +308,7 @@ public abstract class MediaProxySession extends Thread implements ProxyCandidate
*/
public void setPortB(int portB) {
if (Log.isDebugEnabled()) {
Log.debug("PORT CHANGED(B):" + portB);
Log.debug("MediaProxySession: PORT CHANGED(B):" + portB);
}
this.portB = portB;
}
......
......@@ -1478,7 +1478,7 @@ public class LocalMUCRoom implements MUCRoom {
occupantRole.setPresence(updatePresence.getPresence());
}
else {
Log.debug("Failed to update presence of room occupant. Occupant nickname: " + updatePresence.getNickname());
Log.debug("LocalMUCRoom: Failed to update presence of room occupant. Occupant nickname: " + updatePresence.getNickname());
}
}
......@@ -1500,7 +1500,7 @@ public class LocalMUCRoom implements MUCRoom {
}
}
else {
Log.debug("Failed to update information of room occupant. Occupant nickname: " + update.getNickname());
Log.debug("LocalMUCRoom: Failed to update information of room occupant. Occupant nickname: " + update.getNickname());
}
}
......@@ -1514,7 +1514,7 @@ public class LocalMUCRoom implements MUCRoom {
return occupantRole.getPresence();
}
else {
Log.debug("Failed to update information of local room occupant. Occupant nickname: " +
Log.debug("LocalMUCRoom: Failed to update information of local room occupant. Occupant nickname: " +
updateRequest.getNickname());
}
return null;
......
......@@ -120,7 +120,7 @@ public class ServerStanzaHandler extends StanzaHandler {
*/
private void packetReceived(Packet packet) throws UnauthorizedException {
if (packet.getTo() == null || packet.getFrom() == null) {
Log.debug("Closing IncomingServerSession due to packet with no TO or FROM: " +
Log.debug("ServerStanzaHandler: Closing IncomingServerSession due to packet with no TO or FROM: " +
packet.toXML());
// Send a stream error saying that the packet includes no TO or FROM
StreamError error = new StreamError(StreamError.Condition.improper_addressing);
......@@ -128,7 +128,7 @@ public class ServerStanzaHandler extends StanzaHandler {
throw new UnauthorizedException("Packet with no TO or FROM attributes");
}
else if (!((LocalIncomingServerSession) session).isValidDomain(packet.getFrom().getDomain())) {
Log.debug("Closing IncomingServerSession due to packet with invalid domain: " +
Log.debug("ServerStanzaHandler: Closing IncomingServerSession due to packet with invalid domain: " +
packet.toXML());
// Send a stream error saying that the packet includes an invalid FROM
StreamError error = new StreamError(StreamError.Condition.invalid_from);
......
......@@ -131,7 +131,7 @@ public abstract class SocketReader implements Runnable {
packet = new Message(doc);
}
catch(IllegalArgumentException e) {
Log.debug("Rejecting packet. JID malformed", e);
Log.debug("SocketReader: Rejecting packet. JID malformed", e);
// The original packet contains a malformed JID so answer with an error.
Message reply = new Message();
reply.setID(doc.attributeValue("id"));
......@@ -149,7 +149,7 @@ public abstract class SocketReader implements Runnable {
packet = new Presence(doc);
}
catch (IllegalArgumentException e) {
Log.debug("Rejecting packet. JID malformed", e);
Log.debug("SocketReader: Rejecting packet. JID malformed", e);
// The original packet contains a malformed JID so answer an error
Presence reply = new Presence();
reply.setID(doc.attributeValue("id"));
......@@ -194,7 +194,7 @@ public abstract class SocketReader implements Runnable {
packet = getIQ(doc);
}
catch(IllegalArgumentException e) {
Log.debug("Rejecting packet. JID malformed", e);
Log.debug("SocketReader: Rejecting packet. JID malformed", e);
// The original packet contains a malformed JID so answer an error
IQ reply = new IQ();
if (!doc.elements().isEmpty()) {
......
......@@ -91,7 +91,7 @@ public abstract class ConnectionHandler extends IoHandlerAdapter {
Connection connection = (Connection) session.getAttribute(CONNECTION);
// Close idle connection
if (Log.isDebugEnabled()) {
Log.debug("Closing connection that has been idle: " + connection);
Log.debug("ConnectionHandler: Closing connection that has been idle: " + connection);
}
connection.close();
}
......@@ -99,7 +99,7 @@ public abstract class ConnectionHandler extends IoHandlerAdapter {
public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
if (cause instanceof IOException) {
// TODO Verify if there were packets pending to be sent and decide what to do with them
Log.debug(cause);
Log.debug("ConnectionHandler: ",cause);
}
else if (cause instanceof ProtocolDecoderException) {
Log.warn("Closing session due to exception: " + session, cause);
......
......@@ -221,7 +221,7 @@ public class NIOConnection implements Connection {
ioSession.write(buffer);
}
catch (Exception e) {
Log.debug("Error delivering packet" + "\n" + this.toString(), e);
Log.debug("NIOConnection: Error delivering packet" + "\n" + this.toString(), e);
errorDelivering = true;
}
if (errorDelivering) {
......@@ -268,7 +268,7 @@ public class NIOConnection implements Connection {
}
}
catch (Exception e) {
Log.debug("Error delivering raw text" + "\n" + this.toString(), e);
Log.debug("NIOConnection: Error delivering raw text" + "\n" + this.toString(), e);
errorDelivering = true;
}
// Close the connection if delivering text fails and we are already not closing the connection
......
......@@ -152,7 +152,7 @@ public class PrivacyList implements Cacheable, Externalizable {
return false;
}
if (Log.isDebugEnabled()) {
Log.debug("Packet was blocked: " + packet);
Log.debug("PrivacyList: Packet was blocked: " + packet);
}
return true;
}
......
......@@ -1646,7 +1646,7 @@ public class PubSubEngine {
formField.addValue(accessModel);
}
else {
Log.debug("Owner sent access model in data form and as attribute: " +
Log.debug("PubSubEngine: Owner sent access model in data form and as attribute: " +
configureElement.asXML());
}
// Check if a list of groups was specified
......
......@@ -108,7 +108,7 @@ public class OutgoingServerSocketReader {
else {
message = message + "No session to close.";
}
Log.debug(message, e);
Log.debug("OutgoingServerSocketReader: "+message, e);
closeSession();
}
catch (Exception e) {
......
......@@ -187,7 +187,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
catch (Exception e) {
returnErrorToSender(packet);
Log.debug(
"Error sending packet to remote server: " + packet,
"OutgoingSessionPromise: Error sending packet to remote server: " + packet,
e);
}
}
......
......@@ -173,7 +173,7 @@ public class LocalClientSession extends LocalSession implements ClientSession {
if (forbidAccess) {
// Client cannot connect from this IP address so end the stream and
// TCP connection
Log.debug("Closed connection to client attempting to connect from: " + hostAddress);
Log.debug("LocalClientSession: Closed connection to client attempting to connect from: " + hostAddress);
// Include the not-authorized error in the response
StreamError error = new StreamError(StreamError.Condition.not_authorized);
connection.deliverRawText(error.toXML());
......
......@@ -64,7 +64,7 @@ public class LocalComponentSession extends LocalSession implements ComponentSess
XmlPullParser xpp = reader.getXPPParser();
String domain = xpp.getAttributeValue("", "to");
Log.debug("[ExComp] Starting registration of new external component for domain: " + domain);
Log.debug("LocalComponentSession: [ExComp] Starting registration of new external component for domain: " + domain);
Writer writer = connection.getWriter();
// Default answer header in case of an error
......@@ -80,7 +80,7 @@ public class LocalComponentSession extends LocalSession implements ComponentSess
// Check that a domain was provided in the stream header
if (domain == null) {
Log.debug("[ExComp] Domain not specified in stanza: " + xpp.getText());
Log.debug("LocalComponentSession: [ExComp] Domain not specified in stanza: " + xpp.getText());
// Include the bad-format in the response
StreamError error = new StreamError(StreamError.Condition.bad_format);
sb.append(error.toXML());
......@@ -101,7 +101,7 @@ public class LocalComponentSession extends LocalSession implements ComponentSess
JID componentJID = new JID(domain);
// Check that an external component for the specified subdomain may connect to this server
if (!ExternalComponentManager.canAccess(subdomain)) {
Log.debug("[ExComp] Component is not allowed to connect with subdomain: " + subdomain);
Log.debug("LocalComponentSession: [ExComp] Component is not allowed to connect with subdomain: " + subdomain);
StreamError error = new StreamError(StreamError.Condition.host_unknown);
sb.append(error.toXML());
writer.write(sb.toString());
......@@ -113,7 +113,7 @@ public class LocalComponentSession extends LocalSession implements ComponentSess
// Check that a secret key was configured in the server
String secretKey = ExternalComponentManager.getSecretForComponent(subdomain);
if (secretKey == null) {
Log.debug("[ExComp] A shared secret for the component was not found.");
Log.debug("LocalComponentSession: [ExComp] A shared secret for the component was not found.");
// Include the internal-server-error in the response
StreamError error = new StreamError(StreamError.Condition.internal_server_error);
sb.append(error.toXML());
......@@ -125,7 +125,7 @@ public class LocalComponentSession extends LocalSession implements ComponentSess
}
// Check that the requested subdomain is not already in use
if (InternalComponentManager.getInstance().hasComponent(componentJID)) {
Log.debug("[ExComp] Another component is already using domain: " + domain);
Log.debug("LocalComponentSession: [ExComp] Another component is already using domain: " + domain);
// Domain already occupied so return a conflict error and close the connection
// Include the conflict error in the response
StreamError error = new StreamError(StreamError.Condition.conflict);
......@@ -142,7 +142,7 @@ public class LocalComponentSession extends LocalSession implements ComponentSess
session.component = new LocalExternalComponent(session, connection);
try {
Log.debug("[ExComp] Send stream header with ID: " + session.getStreamID() +
Log.debug("LocalComponentSession: [ExComp] Send stream header with ID: " + session.getStreamID() +
" for component with domain: " +
domain);
// Build the start packet response
......@@ -166,7 +166,7 @@ public class LocalComponentSession extends LocalSession implements ComponentSess
String anticipatedDigest = AuthFactory.createDigest(session.getStreamID().getID(), secretKey);
// Check that the provided handshake (secret key + sessionID) is correct
if (!anticipatedDigest.equalsIgnoreCase(digest)) {
Log.debug("[ExComp] Incorrect handshake for component with domain: " + domain);
Log.debug("LocalComponentSession: [ExComp] Incorrect handshake for component with domain: " + domain);
// The credentials supplied by the initiator are not valid (answer an error
// and close the connection)
writer.write(new StreamError(StreamError.Condition.not_authorized).toXML());
......@@ -184,7 +184,7 @@ public class LocalComponentSession extends LocalSession implements ComponentSess
// Bind the domain to this component
ExternalComponent component = session.getExternalComponent();
InternalComponentManager.getInstance().addComponent(subdomain, component);
Log.debug("[ExComp] External component was registered SUCCESSFULLY with domain: " + domain);
Log.debug("LocalComponentSession: [ExComp] External component was registered SUCCESSFULLY with domain: " + domain);
return session;
}
}
......
......@@ -59,7 +59,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
throws XmlPullParserException {
String domain = xpp.getAttributeValue("", "to");
Log.debug("[ConMng] Starting registration of new connection manager for domain: " + domain);
Log.debug("LocalConnectionMultiplexerSession: [ConMng] Starting registration of new connection manager for domain: " + domain);
// Default answer header in case of an error
StringBuilder sb = new StringBuilder();
......@@ -74,7 +74,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
// Check that a domain was provided in the stream header
if (domain == null) {
Log.debug("[ConMng] Domain not specified in stanza: " + xpp.getText());
Log.debug("LocalConnectionMultiplexerSession: [ConMng] Domain not specified in stanza: " + xpp.getText());
// Include the bad-format in the response
StreamError error = new StreamError(StreamError.Condition.bad_format);
sb.append(error.toXML());
......@@ -89,7 +89,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
// Check that a secret key was configured in the server
String secretKey = ConnectionMultiplexerManager.getDefaultSecret();
if (secretKey == null) {
Log.debug("[ConMng] A shared secret for connection manager was not found.");
Log.debug("LocalConnectionMultiplexerSession: [ConMng] A shared secret for connection manager was not found.");
// Include the internal-server-error in the response
StreamError error = new StreamError(StreamError.Condition.internal_server_error);
sb.append(error.toXML());
......@@ -100,7 +100,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
}
// Check that the requested subdomain is not already in use
if (SessionManager.getInstance().getConnectionMultiplexerSession(address) != null) {
Log.debug("[ConMng] Another connection manager is already using domain: " + domain);
Log.debug("LocalConnectionMultiplexerSession: [ConMng] Another connection manager is already using domain: " + domain);
// Domain already occupied so return a conflict error and close the connection
// Include the conflict error in the response
StreamError error = new StreamError(StreamError.Condition.conflict);
......@@ -130,7 +130,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
connection.init(session);
try {
Log.debug("[ConMng] Send stream header with ID: " + session.getStreamID() +
Log.debug("LocalConnectionMultiplexerSession: [ConMng] Send stream header with ID: " + session.getStreamID() +
" for connection manager with domain: " +
domain);
// Build the start packet response
......@@ -209,7 +209,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
ConnectionMultiplexerManager.getDefaultSecret());
// Check that the provided handshake (secret key + sessionID) is correct
if (!anticipatedDigest.equalsIgnoreCase(digest)) {
Log.debug("[ConMng] Incorrect handshake for connection manager with domain: " +
Log.debug("LocalConnectionMultiplexerSession: [ConMng] Incorrect handshake for connection manager with domain: " +
getAddress().getDomain());
// The credentials supplied by the initiator are not valid (answer an error
// and close the connection)
......@@ -223,7 +223,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
setStatus(STATUS_AUTHENTICATED);
// Send empty handshake element to acknowledge success
conn.deliverRawText("<handshake></handshake>");
Log.debug("[ConMng] Connection manager was AUTHENTICATED with domain: " + getAddress());
Log.debug("LocalConnectionMultiplexerSession: [ConMng] Connection manager was AUTHENTICATED with domain: " + getAddress());
sendClientOptions();
return true;
}
......
......@@ -100,7 +100,7 @@ public class LocalIncomingServerSession extends LocalSession implements Incoming
ServerDialback method = new ServerDialback(connection, serverName);
return method.createIncomingSession(reader);
}
Log.debug("Server dialback is disabled. Rejecting connection: " + connection);
Log.debug("LocalIncomingServerSession: Server dialback is disabled. Rejecting connection: " + connection);
}
String version = xpp.getAttributeValue("", "version");
int[] serverVersion = version != null ? decodeVersion(version) : new int[] {0,0};
......@@ -117,7 +117,7 @@ public class LocalIncomingServerSession extends LocalSession implements Incoming
else {
connection.deliverRawText(
new StreamError(StreamError.Condition.invalid_namespace).toXML());
Log.debug("Server TLS is disabled. Rejecting connection: " + connection);
Log.debug("LocalIncomingServerSession: Server TLS is disabled. Rejecting connection: " + connection);
}
}
// Close the connection since remote server is not XMPP 1.0 compliant and is not
......
......@@ -247,12 +247,12 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
DNSUtil.HostAddress address = DNSUtil.resolveXMPPServerDomain(hostname, port);
realHostname = address.getHost();
realPort = address.getPort();
Log.debug("OS - Trying to connect to " + hostname + ":" + port +
Log.debug("LocalOutgoingServerSession: OS - Trying to connect to " + hostname + ":" + port +
"(DNS lookup: " + realHostname + ":" + realPort + ")");
// Establish a TCP connection to the Receiving Server
socket.connect(new InetSocketAddress(realHostname, realPort),
RemoteServerManager.getSocketTimeout());
Log.debug("OS - Plain connection to " + hostname + ":" + port + " successful");
Log.debug("LocalOutgoingServerSession: OS - Plain connection to " + hostname + ":" + port + " successful");
}
catch (Exception e) {
Log.error("Error trying to connect to remote server: " + hostname +
......@@ -308,7 +308,7 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
}
}
else {
Log.debug("OS - Error, <starttls> was not received");
Log.debug("LocalOutgoingServerSession: OS - Error, <starttls> was not received");
}
}
// Something went wrong so close the connection and try server dialback over
......@@ -318,7 +318,7 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
}
}
catch (SSLHandshakeException e) {
Log.debug("Handshake error while creating secured outgoing session to remote " +
Log.debug("LocalOutgoingServerSession: Handshake error while creating secured outgoing session to remote " +
"server: " + hostname + "(DNS lookup: " + realHostname + ":" + realPort +
")", e);
// Close the connection
......@@ -344,7 +344,7 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
}
}
if (ServerDialback.isEnabled()) {
Log.debug("OS - Going to try connecting using server dialback with: " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Going to try connecting using server dialback with: " + hostname);
// Use server dialback over a plain connection
return new ServerDialback().createOutgoingSession(domain, hostname, port);
}
......@@ -355,19 +355,19 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
SocketConnection connection, XMPPPacketReader reader, StringBuilder openingStream,
String domain) throws Exception {
Element features;
Log.debug("OS - Indicating we want TLS to " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Indicating we want TLS to " + hostname);
connection.deliverRawText("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
MXParser xpp = reader.getXPPParser();
// Wait for the <proceed> response
Element proceed = reader.parseDocument().getRootElement();
if (proceed != null && proceed.getName().equals("proceed")) {
Log.debug("OS - Negotiating TLS with " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Negotiating TLS with " + hostname);
boolean needed = JiveGlobals.getBooleanProperty("xmpp.server.certificate.verify", true) &&
JiveGlobals.getBooleanProperty("xmpp.server.certificate.verify.chain", true) &&
!JiveGlobals.getBooleanProperty("xmpp.server.certificate.accept-selfsigned", false);
connection.startTLS(true, hostname, needed ? Connection.ClientAuth.needed : Connection.ClientAuth.wanted);
Log.debug("OS - TLS negotiation with " + hostname + " was successful");
Log.debug("LocalOutgoingServerSession: OS - TLS negotiation with " + hostname + " was successful");
// TLS negotiation was successful so initiate a new stream
connection.deliverRawText(openingStream.toString());
......@@ -408,7 +408,7 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
// Server confirmed that we can use zlib compression
connection.addCompression();
connection.startCompression();
Log.debug("OS - Stream compression was successful with " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Stream compression was successful with " + hostname);
// Stream compression was successful so initiate a new stream
connection.deliverRawText(openingStream.toString());
// Reset the parser to use stream compression over TLS
......@@ -424,22 +424,22 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
// Get new stream features
features = reader.parseDocument().getRootElement();
if (features == null || features.element("mechanisms") == null) {
Log.debug("OS - Error, EXTERNAL SASL was not offered by " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Error, EXTERNAL SASL was not offered by " + hostname);
return null;
}
}
else {
Log.debug("OS - Stream compression was rejected by " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Stream compression was rejected by " + hostname);
}
}
else {
Log.debug(
"OS - Stream compression found but zlib method is not supported by" +
"LocalOutgoingServerSession: OS - Stream compression found but zlib method is not supported by" +
hostname);
}
}
else {
Log.debug("OS - Stream compression not supoprted by " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Stream compression not supoprted by " + hostname);
}
}
......@@ -447,9 +447,9 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
while (it.hasNext()) {
Element mechanism = (Element) it.next();
if ("EXTERNAL".equals(mechanism.getTextTrim())) {
Log.debug("OS - Starting EXTERNAL SASL with " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Starting EXTERNAL SASL with " + hostname);
if (doExternalAuthentication(domain, connection, reader)) {
Log.debug("OS - EXTERNAL SASL with " + hostname + " was successful");
Log.debug("LocalOutgoingServerSession: OS - EXTERNAL SASL with " + hostname + " was successful");
// SASL was successful so initiate a new stream
connection.deliverRawText(openingStream.toString());
......@@ -475,20 +475,20 @@ public class LocalOutgoingServerSession extends LocalSession implements Outgoing
return session;
}
else {
Log.debug("OS - Error, EXTERNAL SASL authentication with " + hostname +
Log.debug("LocalOutgoingServerSession: OS - Error, EXTERNAL SASL authentication with " + hostname +
" failed");
return null;
}
}
}
Log.debug("OS - Error, EXTERNAL SASL was not offered by " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Error, EXTERNAL SASL was not offered by " + hostname);
}
else {
Log.debug("OS - Error, no SASL mechanisms were offered by " + hostname);
Log.debug("LocalOutgoingServerSession: OS - Error, no SASL mechanisms were offered by " + hostname);
}
}
else {
Log.debug("OS - Error, <proceed> was not received");
Log.debug("LocalOutgoingServerSession: OS - Error, <proceed> was not received");
}
return null;
}
......
......@@ -296,7 +296,7 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust
if (!routed) {
if (Log.isDebugEnabled()) {
Log.debug("Failed to route packet to JID: " + jid + " packet: " + packet);
Log.debug("RoutingTableImpl: Failed to route packet to JID: " + jid + " packet: " + packet);
}
if (packet instanceof IQ) {
iqRouter.routingFailed(jid, packet);
......
......@@ -419,7 +419,7 @@ public class STUNService extends BasicModule {
}
try {
Log.debug("RETURNED:" + reply.toXML());
Log.debug("STUNService: RETURNED:" + reply.toXML());
}
catch (Exception e) {
Log.error(e);
......
......@@ -169,7 +169,7 @@ public class JDBCUserProvider implements UserProvider {
// to load the entire result set into memory.
DbConnectionManager.setFetchSize(rs, 500);
while (rs.next()) {
Log.debug(rs.getString(1));
Log.debug("JDBCUserProvider: "+rs.getString(1));
usernames.add(rs.getString(1));
}
}
......@@ -195,7 +195,7 @@ public class JDBCUserProvider implements UserProvider {
DbConnectionManager.scrollResultSet(rs, startIndex);
int count = 0;
while (rs.next() && count < numResults) {
Log.debug(rs.getString(1));
Log.debug("JDBCUserProvider: "+rs.getString(1));
usernames.add(rs.getString(1));
count++;
}
......@@ -300,7 +300,7 @@ public class JDBCUserProvider implements UserProvider {
.append(" LIKE '")
.append(StringUtils.escapeForSQL(query)).append("'");
}
Log.debug(sql.toString());
Log.debug("JDBCUserProvider: "+sql.toString());
rs = stmt.executeQuery(sql.toString());
while (rs.next()) {
usernames.add(rs.getString(1));
......@@ -375,7 +375,7 @@ public class JDBCUserProvider implements UserProvider {
.append(" LIKE '")
.append(StringUtils.escapeForSQL(query)).append("'");
}
Log.debug(sql.toString());
Log.debug("JDBCUserProvider: "+sql.toString());
rs = stmt.executeQuery(sql.toString());
// Scroll to the start index.
DbConnectionManager.scrollResultSet(rs, startIndex);
......
......@@ -34,15 +34,15 @@ public class JettyLog implements Logger {
public void info(String string, Object object, Object object1) {
// Send info log messages to debug because they are generally not useful.
Log.debug(string);
Log.debug("JettyLog: "+string);
}
public void debug(String string, Throwable throwable) {
Log.debug(string, throwable);
Log.debug("JettyLog: "+string, throwable);
}
public void debug(String string, Object object, Object object1) {
Log.debug(string);
Log.debug("JettyLog: "+string);
}
public void warn(String string, Object object, Object object1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment