{"id":2338,"date":"2022-08-30T15:24:02","date_gmt":"2022-08-30T15:24:02","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/05\/how-to-configure-tomcat-to-log-requests-before-they-are-executed-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:24:02","modified_gmt":"2022-08-30T15:24:02","slug":"how-to-configure-tomcat-to-log-requests-before-they-are-executed-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-to-configure-tomcat-to-log-requests-before-they-are-executed-collection-of-common-programming-errors\/","title":{"rendered":"How to configure Tomcat to log requests before they are executed?-Collection of common programming errors"},"content":{"rendered":"<p>Tomcat&#8217;s AccessLogValve has the <code>buffered<\/code> configuration option which defaults to <code>true<\/code>, which means that if Tomcat crashes, you might lose the buffer&#8217;s worth of logs. See http:\/\/tomcat.apache.org\/tomcat-7.0-doc\/config\/valve.html#Access_Log_Valve.<\/p>\n<p>You might want to try and set <code>buffered<\/code> to <code>false<\/code>, which would then make the valve flush the log on every request, bearing in mind that this will probably affect overall performance.<\/p>\n<p>Another option is to place e.g. an Apache reverse proxy in front of Tomcat (using mod_proxy, mod_jk, mod_ajp or mod_cluster) and have it do the request logging.<\/p>\n<p id=\"rop\"><small>Originally posted 2014-01-05 21:45:44. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Tomcat&#8217;s AccessLogValve has the buffered configuration option which defaults to true, which means that if Tomcat crashes, you might lose the buffer&#8217;s worth of logs. See http:\/\/tomcat.apache.org\/tomcat-7.0-doc\/config\/valve.html#Access_Log_Valve. You might want to try and set buffered to false, which would then make the valve flush the log on every request, bearing in mind that this will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2338","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2338"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2338\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}