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