{"id":665,"date":"2012-06-28T17:53:25","date_gmt":"2012-06-28T17:53:25","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=665"},"modified":"2012-06-28T17:53:25","modified_gmt":"2012-06-28T17:53:25","slug":"oversized-log-files-difficult-analyze","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/oversized-log-files-difficult-analyze\/","title":{"rendered":"Oversized log files are difficult to analyze"},"content":{"rendered":"<p>If you&#39;re like me, when a web access related problem strikes, my quickest path to diagnosing the issue is to open up Apache log files with vi or nano.<\/p>\n<p>This happened to me the other day, and I was surprised to find that even though my logs rotate out weekly, the rotated files were still almost 1GB in size.<\/p>\n<p>So, it got me thinking. Why do I have 4 log files, one for each of the past 4 weeks. When a problem strikes, I always solve it within 24 hours. Google analytics takes care of the traffic analysis.<\/p>\n<p>I decided to opt for daily <a href=\"http:\/\/linuxcommand.org\/man_pages\/logrotate8.html\">log rotation<\/a>, and only keep the most recent 7 days. This will cut my log size down to 25% it&#39;s original size, and make them far less time and memory consuming to open via the command line.<\/p>\n<p>A snippet from \/etc\/logrotate.conf<\/p>\n<p><code># rotate log files weekly<br \/>\n\tdaily<\/p>\n<p>\t# keep 4 weeks worth of backlogs<br \/>\n\trotate 7<\/p>\n<p>\t<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#39;re like me, when a web access related problem strikes, my quickest path to diagnosing the issue is to open up Apache log files&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[41],"tags":[141],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/665"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=665"}],"version-history":[{"count":2,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/665\/revisions"}],"predecessor-version":[{"id":667,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/665\/revisions\/667"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}