remm 01/02/15 19:28:11
Modified: catalina/src/share/org/apache/catalina/valves
AccessLogValve.java
Log:
- Don't resolve host names by default. That can be set back on using the
a resolveHosts="true" in server.xml. This will prevent timeouts when the DNS
lookup fails.
Thanks a lot to Michael Smith <[EMAIL PROTECTED]> for reporting the problem and
helping debug it.
Revision Changes Path
1.5 +33 -2
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/AccessLogValve.java
Index: AccessLogValve.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/valves/AccessLogValve.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AccessLogValve.java 2001/01/23 02:53:03 1.4
+++ AccessLogValve.java 2001/02/16 03:28:10 1.5
@@ -126,7 +126,7 @@
*
* @author Craig R. McClanahan
* @author Jason Brittain
- * @version $Revision: 1.4 $ $Date: 2001/01/23 02:53:03 $
+ * @version $Revision: 1.5 $ $Date: 2001/02/16 03:28:10 $
*/
public final class AccessLogValve
@@ -285,6 +285,12 @@
private String space = " ";
+ /**
+ * Resolve hosts.
+ */
+ private boolean resolveHosts = false;
+
+
// ------------------------------------------------------------- Properties
@@ -395,6 +401,28 @@
}
+ /**
+ * Set the resolve hosts flag.
+ *
+ * @param resolveHosts The new resolve hosts value
+ */
+ public void setResolveHosts(boolean resolveHosts) {
+
+ this.resolveHosts = resolveHosts;
+
+ }
+
+
+ /**
+ * Get the value of the resolve hosts flag.
+ */
+ public boolean isResolveHosts() {
+
+ return resolveHosts;
+
+ }
+
+
// --------------------------------------------------------- Public Methods
@@ -429,7 +457,10 @@
if (req instanceof HttpServletRequest)
hreq = (HttpServletRequest) req;
- result.append(req.getRemoteHost());
+ if (isResolveHosts())
+ result.append(req.getRemoteHost());
+ else
+ result.append(req.getRemoteAddr());
result.append(" - ");
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]