RE: Conditional logging
-Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Tuesday, July 22, 2014 11:06 AM To: Tomcat Users List Subject: Re: Conditional logging -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Kris, On 7/22/14, 10:22 AM, Dames, Kristopher J wrote: Kris, On 7/21/14, 6:43 PM, Dames, Kristopher J wrote: Can anyone point me to an example of conditional logging in Tomcat 6? Here is what I have tried to no avail. I want requests that match /*/iaahb to not be logged. In my server.xml: Valve className=org.apache.catalina.valves.AccessLogValve condition=DoNotLog directory=logs fileDateFormat=-MM-dd pattern=%{X-Forwarded-For}i %h %l %u %t quot;%rquot; %s %b quot;%{Referer}iquot; quot;%{User-Agent}iquot; prefix=access_log/ in my web.xml: !-- Custom filter to prevent logging health check requests -- filter filter-nameSet Do Not Log Attribute/filter-name filter-classSetDoNotLogFilter/filter-class init-param param-nameDoNotLog/param-name param-valuetrue/param-value /init-param /filter filter-mapping filter-nameSet Do Not Log Attribute/filter-name url-pattern/*/iaahb/url-pattern /filter-mapping On the face of it, this looks like it should work. What does your SetDoNoLogFilter code look like? - -chris Perhaps that's my problem, I do not have any code to support this. I think for this to work as I have it now I need an existing Java filter class. Hah. Okay, so then what does SetDoNotLogFilter refer to? Or were you just hoping that would magically work? Yes, I was hoping for a little magic. Conditional logging seems like such a basic concept that I am greatly surprised to have to jump through hoops to achieve it. The documentation I've read for filters seems to be intended for an audience with prior webapp development experience. Unfortunately I do not fall into that crowd, so I was unaware a filter had to be related to another piece of configuration/code. I am looking into the url-rewrite filter as suggested. Thanks! -- Kris Dames Mark's response was prescient: you probably want to use the url-rewrite filter because it will avoid you having to write any new code. - -chris This electronic mail and any attached documents are intended solely for the named addressee(s) and contain confidential information. If you are not an addressee, or responsible for delivering this email to an addressee, you have received this email in error and are notified that reading, copying, or disclosing this email is prohibited. If you received this email in error, immediately reply to the sender and delete the message completely from your computer system.
RE: Conditional logging
Kris, On 7/21/14, 6:43 PM, Dames, Kristopher J wrote: Can anyone point me to an example of conditional logging in Tomcat 6? Here is what I have tried to no avail. I want requests that match /*/iaahb to not be logged. In my server.xml: Valve className=org.apache.catalina.valves.AccessLogValve condition=DoNotLog directory=logs fileDateFormat=-MM-dd pattern=%{X-Forwarded-For}i %h %l %u %t quot;%rquot; %s %b quot;%{Referer}iquot; quot;%{User-Agent}iquot; prefix=access_log/ in my web.xml: !-- Custom filter to prevent logging health check requests -- filter filter-nameSet Do Not Log Attribute/filter-name filter-classSetDoNotLogFilter/filter-class init-param param-nameDoNotLog/param-name param-valuetrue/param-value /init-param /filter filter-mapping filter-nameSet Do Not Log Attribute/filter-name url-pattern/*/iaahb/url-pattern /filter-mapping On the face of it, this looks like it should work. What does your SetDoNoLogFilter code look like? - -chris Perhaps that's my problem, I do not have any code to support this. I think for this to work as I have it now I need an existing Java filter class. -- Kris Dames This electronic mail and any attached documents are intended solely for the named addressee(s) and contain confidential information. If you are not an addressee, or responsible for delivering this email to an addressee, you have received this email in error and are notified that reading, copying, or disclosing this email is prohibited. If you received this email in error, immediately reply to the sender and delete the message completely from your computer system. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Conditional logging
Can anyone point me to an example of conditional logging in Tomcat 6? Here is what I have tried to no avail. I want requests that match /*/iaahb to not be logged. In my server.xml: Valve className=org.apache.catalina.valves.AccessLogValve condition=DoNotLog directory=logs fileDateFormat=-MM-dd pattern=%{X-Forwarded-For}i %h %l %u %t quot;%rquot; %s %b quot;%{Referer}iquot; quot;%{User-Agent}iquot; prefix=access_log/ in my web.xml: !-- Custom filter to prevent logging health check requests -- filter filter-nameSet Do Not Log Attribute/filter-name filter-classSetDoNotLogFilter/filter-class init-param param-nameDoNotLog/param-name param-valuetrue/param-value /init-param /filter filter-mapping filter-nameSet Do Not Log Attribute/filter-name url-pattern/*/iaahb/url-pattern /filter-mapping -- Kris Dames This electronic mail and any attached documents are intended solely for the named addressee(s) and contain confidential information. If you are not an addressee, or responsible for delivering this email to an addressee, you have received this email in error and are notified that reading, copying, or disclosing this email is prohibited. If you received this email in error, immediately reply to the sender and delete the message completely from your computer system.
Maximum HTTP parameters
My webapp needs to pass several thousand parameters in an HTTP POST request. I am required to use RHEL's tomcat packages (currently on 6.0.24). I figured out Red Hat has capped the maximum HTTP parameters at 512 and to get around it, I have to add the Java parameter -Dorg.apache.tomcat.util.http.Parameters.MAX_COUNT=5000 to the JVM. I know this isn't strictly a Tomcat issue since the problem is Red Hat's doing, but is anyone aware if it is possible to set this value to unlimited? I tried setting it to 0 and -1 but they were treated as literal values. -- Kris Dames This email contains information which may be PROPRIETARY IN NATURE OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE and is intended only for the use of the addresses(s) named above. If you have received this email in error, please contact the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: What if my database is unavailable at startup?
-Original Message- From: Jose MarĂa Zaragoza [mailto:demablo...@gmail.com] Sent: Friday, December 13, 2013 2:33 PM To: Tomcat Users List Subject: Re: What if my database is unavailable at startup? 2013/12/13 Dames, Kristopher J kristopher.da...@mercy.net: With testOnBorrow=true ( I think that is the default value in Tomcat 6 ) + validationQuery=SELECT 1 FROM DUAL , that should work So you are saying my configuration should work as-is to allow Tomcat to create a database connection pool to a database that was unavailable when Tomcat was started? Yes , I do it and it works But I dont use some parameters like maxOpenPreparedStatements , accessToUnderlyingConnectionAllowed Furthermore, I use default values for testOnXXX The others , at first sight, are similar Tomcat appears to be working properly. Another webapp in the same Tomcat instance does recover once the database becomes available. The one that does not is using an older Oracle driver. In addition, both are JRuby on Rails webapps and the non-working one is using an older version of Rails. So the issue seems to be with the webapp instead of with Tomcat itself. Thank you all for the input and direction! -- Kris Dames I've never used maxOpenPreparedStatements=0 accessToUnderlyingConnectionAllowed=false what are they for ? maxOpenPreparedStatements: The maximum number of open statements that can be allocated from the statement pool at the same time accessToUnderlyingConnectionAllowed: Allows the raw physical connection to the database to be accessed by the webapp This email contains information which may be PROPRIETARY IN NATURE OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE and is intended only for the use of the addresses(s) named above. If you have received this email in error, please contact the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org This email contains information which may be PROPRIETARY IN NATURE OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE and is intended only for the use of the addresses(s) named above. If you have received this email in error, please contact the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
What if my database is unavailable at startup?
Hi, I use tomcat 6 and have noticed if a database is not available when tomcat starts, tomcat will not try to connect once the database becomes available. Tomcat must be restarted to establish the database connection. What are best practices regarding this? Is there a way in tomcat to get it to automatically retry so I don't have to restart tomcat? I use DBCP but am willing to try some other pool. -- Kris D. This email contains information which may be PROPRIETARY IN NATURE OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE and is intended only for the use of the addresses(s) named above. If you have received this email in error, please contact the sender immediately.
RE: What if my database is unavailable at startup?
Daniel, I use tomcat 6.0.32. Here is an example Resource tag: Resource accessToUnderlyingConnectionAllowed=false auth=Container defaultAutoCommit=true defaultReadOnly=false defaultSchema=x driverClassName=oracle.jdbc.driver.OracleDriver factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory initialSize=0 logAbandoned=false maxActive=20 maxIdle=8 maxOpenPreparedStatements=0 maxWait=5000 minEvictableIdleTimeMillis=180 minIdle=5 name=jdbc/x numTestsPerEvictionRun=3 password=x poolPreparedStatements=false removeAbandoned=true removeAbandonedTimeout=300 testOnBorrow=true testOnReturn=false testWhileIdle=true timeBetweenEvictionRunsMillis=180 type=javax.sql.DataSource url=jdbc:oracle:thin:@x.y.com:1521:x username=x validationQuery=SELECT 1 FROM DUAL / This email contains information which may be PROPRIETARY IN NATURE OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE and is intended only for the use of the addresses(s) named above. If you have received this email in error, please contact the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: What if my database is unavailable at startup?
With testOnBorrow=true ( I think that is the default value in Tomcat 6 ) + validationQuery=SELECT 1 FROM DUAL , that should work So you are saying my configuration should work as-is to allow Tomcat to create a database connection pool to a database that was unavailable when Tomcat was started? I've never used maxOpenPreparedStatements=0 accessToUnderlyingConnectionAllowed=false what are they for ? maxOpenPreparedStatements: The maximum number of open statements that can be allocated from the statement pool at the same time accessToUnderlyingConnectionAllowed: Allows the raw physical connection to the database to be accessed by the webapp This email contains information which may be PROPRIETARY IN NATURE OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE and is intended only for the use of the addresses(s) named above. If you have received this email in error, please contact the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: What if my database is unavailable at startup?
can/should we assume that your URL is referencing a database on a different machine, same network/intranet/LAN? url=jdbc:oracle:thin:@x.y.com:1521:x it seems as though OP is referencing a database somewhere on the 'internet'. The database server is on the same network, different machine. -- Kris D. This email contains information which may be PROPRIETARY IN NATURE OR OTHERWISE PROTECTED BY LAW FROM DISCLOSURE and is intended only for the use of the addresses(s) named above. If you have received this email in error, please contact the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org