{"id":523,"date":"2026-04-15T16:55:03","date_gmt":"2026-04-15T20:55:03","guid":{"rendered":"http:\/\/wfredk.com\/blog\/?p=523"},"modified":"2026-04-15T17:00:29","modified_gmt":"2026-04-15T21:00:29","slug":"a-design-pattern-to-avoid","status":"publish","type":"post","link":"https:\/\/wfredk.com\/blog\/2026041516\/a-design-pattern-to-avoid","title":{"rendered":"A &#8220;design pattern&#8221; to avoid"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"> <strong><em>NEVER<\/em><\/strong>  write some random piece of  bare data to common (system-wide, site-wide, etc.) logs, e.g. in <strong>PHP<\/strong>  using <code>error_log()<\/code>, even during &#8220;quick&#8221; debugging:  <strong><em>ALWAYS<\/em><\/strong> include some kind of tag <em><strong>identifying <\/strong><\/em>the piece of data and <strong><em>why <\/em><\/strong>it is being logged.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you get interrupted and forget you put that logging in, and don&#8217;t discover it in the logs until a week later when that task had long since gone out of your mind, you could end up spending easily half an hour chasing the source of the &#8220;problem&#8221; down.<\/p>\n<div id=\"spreadx\">&nbsp;<a href=\"http:\/\/digg.com\/submit?phase=2&url=https:\/\/wfredk.com\/blog\/2026041516\/a-design-pattern-to-avoid\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/digg.gif\" alt=\"Digg\" border=\"0\" \/><\/a>&nbsp;&nbsp;<a href=\"http:\/\/www.facebook.com\/share.php?u=https:\/\/wfredk.com\/blog\/2026041516\/a-design-pattern-to-avoid\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/facebook.gif\" alt=\"Facebook\" border=\"0\" \/><\/a>&nbsp;&nbsp;<a href=\"http:\/\/www.stumbleupon.com\/submit?url=https:\/\/wfredk.com\/blog\/2026041516\/a-design-pattern-to-avoid&title=A+%26%238220%3Bdesign+pattern%26%238221%3B+to+avoid\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/stumble.gif\" alt=\"StumbleUpon\" border=\"0\" \/><\/a>&nbsp;&nbsp;<a href=\"http:\/\/technorati.com\/faves?add=https:\/\/wfredk.com\/blog\/2026041516\/a-design-pattern-to-avoid\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/technorati.gif\" alt=\"Technorati\" border=\"0\" \/><\/a>&nbsp;&nbsp;<a href=\"http:\/\/del.icio.us\/post?url=https:\/\/wfredk.com\/blog\/2026041516\/a-design-pattern-to-avoid&title=A+%26%238220%3Bdesign+pattern%26%238221%3B+to+avoid\" target=\"_new\"><img decoding=\"async\" src=\"https:\/\/wfredk.com\/blog\/wp-content\/plugins\/spreadx\/images\/delicious.gif\" alt=\"Deli.cio.us\" border=\"0\" \/><\/a>&nbsp;<\/div>","protected":false},"excerpt":{"rendered":"<p>NEVER write some random piece of bare data to common (system-wide, site-wide, etc.) logs, e.g. in PHP using error_log(), even during &#8220;quick&#8221; debugging: ALWAYS include some kind of tag identifying the piece of data and why it is being logged. If you get interrupted and forget you put that logging in, and don&#8217;t discover it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,34,28],"tags":[],"class_list":["post-523","post","type-post","status-publish","format-standard","hentry","category-bugfix","category-good-advice","category-software-development"],"_links":{"self":[{"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/posts\/523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/comments?post=523"}],"version-history":[{"count":3,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/posts\/523\/revisions"}],"predecessor-version":[{"id":526,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/posts\/523\/revisions\/526"}],"wp:attachment":[{"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/media?parent=523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/categories?post=523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wfredk.com\/blog\/wp-json\/wp\/v2\/tags?post=523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}