CLOUDSTACK-3274: Remove duplicate cleanString calls in logging api for

performance improvement.
This commit is contained in:
Min Chen 2013-08-16 10:46:22 -07:00
parent 4f8fe9c062
commit 71b36e8ff7
2 changed files with 5 additions and 5 deletions

View File

@ -314,7 +314,7 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
throw e;
}
} finally {
s_accessLogger.info(StringUtils.cleanString(sb.toString()));
s_accessLogger.info(sb.toString());
UserContext.unregisterContext();
}
}

View File

@ -119,8 +119,8 @@ public class ApiServlet extends HttpServlet {
// logging the request start and end in management log for easy debugging
String reqStr = "";
if (s_logger.isDebugEnabled()) {
reqStr = auditTrailSb.toString() + " " + req.getQueryString();
s_logger.debug("===START=== " + StringUtils.cleanString(reqStr));
reqStr = auditTrailSb.toString() + " " + StringUtils.cleanString(req.getQueryString());
s_logger.debug("===START=== " + reqStr);
}
try {
@ -326,9 +326,9 @@ public class ApiServlet extends HttpServlet {
s_logger.error("unknown exception writing api response", ex);
auditTrailSb.append(" unknown exception writing api response");
} finally {
s_accessLogger.info(StringUtils.cleanString(auditTrailSb.toString()));
s_accessLogger.info(auditTrailSb.toString());
if (s_logger.isDebugEnabled()) {
s_logger.debug("===END=== " + StringUtils.cleanString(reqStr));
s_logger.debug("===END=== " + reqStr);
}
// cleanup user context to prevent from being peeked in other request context
UserContext.unregisterContext();