{"id":458,"date":"2011-09-08T10:05:43","date_gmt":"2011-09-08T18:05:43","guid":{"rendered":"http:\/\/raffy.ch\/blog\/?p=458"},"modified":"2011-09-07T19:37:24","modified_gmt":"2011-09-08T03:37:24","slug":"logging-guidelines-enable-action","status":"publish","type":"post","link":"https:\/\/raffy.ch\/blog\/2011\/09\/08\/logging-guidelines-enable-action\/","title":{"rendered":"Logging Guidelines Enable Actions"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/raffy.ch\/blog\/wp-content\/uploads\/2011\/09\/images.jpeg\" alt=\"Log Book\" title=\"Log Book\" width=\"180\" style=\"float:right;\" \/>Analyzing log files can be a very time consuming process and it doesn&#8217;t seem to get any easier. In the past 12 years I have been on both sides of the table. I have analyzed terabytes of logs and I have written a lot of code that generates logs. When I started writing Loggly&#8217;s middleware, I thought it was going to be really easy and fun to finally write the perfect application logs. Guess what, I was wrong. Although I have seen pretty much any log format out there, I had the hardest time coming up with a decent log format for ourselves. What&#8217;s a good log format anyways? The short answer is: &#8220;One that enables analytics or actions.&#8221; <\/p>\n<p>I was sufficiently motivated to come up with a good log format that I decided to write a paper about <a href=\"http:\/\/pixlcloud.com\/applicationlogging.pdf\">application logging guidelines<\/a>. The paper has two main parts: Logging Guidelines and a reference architecture for a cloud service. In the first part I am covering the questions of <strong>when<\/strong> to log, <strong>what<\/strong> to log, and <strong>how<\/strong> to log. It&#8217;s not as easy as you might think. The most important thing to constantly keep in mind is the use of the logs. Especially for the question on what to log you need to keep the log consumer in mind. Are the logs consumed by a human? Are they consumed by a log management tool? What are the people looking at the logs trying to do? Debugging the application? Monitoring performance? Detecting security violations? Depending on the answers to these questions, you might change the places in your code that you emit log records. (Or even better you log in all places and add a use-case indicator as a field to your logs.)<\/p>\n<p>The paper is a starting point and not a definite guide. I would expect readers to challenge it and come up with improvements and refinements of use-cases and also the exact contents of the log records. I&#8217;d love to hear from practitioners and get a dialog going.<\/p>\n<p>As a side note: CEE, the <a href=\"http:\/\/cee.mitre.org\">Common Event Expression<\/a> standard, covers parts of what I am talking about in the paper. However, the paper&#8217;s focus is mainly on defining guidelines for application developers; establishing a baseline of when log entries should be recorded and what information should be included.\n<\/p>\n<p>Resources: <strong>Cloud Application Logging for Forensics<\/strong> &#8211; <a href=\"http:\/\/pixlcloud.com\/applicationlogging.pdf\">Paper<\/a> &#8211; <a href=\"http:\/\/www.slideshare.net\/zrlram\/cloud-application-logging-for-forensics\">Presentation<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Analyzing log files can be a very time consuming process and it doesn&#8217;t seem to get any easier. In the past 12 years I have been on both sides of the table. I have analyzed terabytes of logs and I have written a lot of code that generates logs. When I started writing Loggly&#8217;s middleware, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,3],"tags":[],"class_list":["post-458","post","type-post","status-publish","format-standard","hentry","category-log-analysis","category-programming"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/comments?post=458"}],"version-history":[{"count":21,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/458\/revisions"}],"predecessor-version":[{"id":480,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/458\/revisions\/480"}],"wp:attachment":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/media?parent=458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/categories?post=458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/tags?post=458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}