{"id":7803,"date":"2015-10-15T12:15:02","date_gmt":"2015-10-15T09:15:02","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=7803"},"modified":"2015-12-16T11:04:47","modified_gmt":"2015-12-16T09:04:47","slug":"logfmt-log-format-thats-easy-read-write","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/","title":{"rendered":"Logfmt: A Log Format That&#8217;s Easy To Read and Write"},"content":{"rendered":"<p>You don\u2019t need to be a logging expert to know that when it comes to logging in applications, there\u2019s a wide variety of options to choose from.<\/p>\n<p>There\u2019s the <a href=\"http:\/\/httpd.apache.org\/docs\/1.3\/logs.html#common\">Common Log Format<\/a>, the <a href=\"http:\/\/httpd.apache.org\/docs\/1.3\/logs.html#combined\">Combined Log Format<\/a>, and <a href=\"https:\/\/www.nginx.com\/resources\/admin-guide\/logging-and-monitoring\/\">Nginx\u2019s log format<\/a>; and on and on the list goes.<\/p>\n<p>But are any of these really the right choice? Honestly, what\u2019s right and wrong is debatable. It\u2019s something that varies from application to application. What\u2019s more, each of the aforementioned formats, as well as the countless others, has its strengths and weaknesses. But are any of them the right one \u2014 at least for you?<\/p>\n<p>Some formats allow for logs which contain copious amounts of information, but then they can turn into an unintelligible mess when it comes time to read them.<\/p>\n<p>Others are simpler, yet don\u2019t allow for as much information to be stored. You can be left without enough information when it comes time to parse them. Dumping a JSON object object can be a good thing, but it too has its drawbacks.<\/p>\n<p>Wouldn\u2019t it be great if there was one that was pretty easy to both read and write, both by humans and by computers? That sounds a little like a Holy Grail of sorts.<\/p>\n<p>However, as part of an application I was developing lately, I came across a log format which, whilst not completely fitting the bill, still does a pretty good job of working for both humans and computers. It\u2019s called logfmt.<\/p>\n<h2>What Is logfmt?<\/h2>\n<p>Logfmt, in essence, simply logs data as a series of one or more key\/value pairs. No more, no less! This might seem simplistic, trivial even. But I find there\u2019s a certain beauty both in the simplicity and flexibility of the format.<\/p>\n<p>There aren\u2019t a set of predefined options, such as in the Common Log Format, which are the only ones you\u2019re able to use. Instead, you\u2019re able to specify exactly what your application needs on a case-by-case basis.<\/p>\n<p>This is great \u2014 you\u2019re able to create log entries to suit specifically what you\u2019re doing. Then, regardless of what\u2019s logged, the format\u2019s always the same. This makes it simpler to create parsers for the information stored.<\/p>\n<p>Let\u2019s look at a simple, concrete example so you can see what it looks like and how to get started. Specifically, I\u2019m using <a href=\"http:\/\/expressjs.com\/\">the Express framework for Node.js<\/a>. This example isn\u2019t the most sophisticated, but it shows a good example of using the library.<\/p>\n<pre class=\" brush:php\">var express = require('express'); \r\nvar logfmt = require('logfmt'); \r\nvar app = express();\r\n\r\nfunction getSomeEnvironmentData(req, res) \r\n{ \r\n  return { \r\n    baseUrl: req.baseUrl, \r\n    hostname: req.hostname, \r\n    protocol: req.protocol, \r\n    name: req.params.name \r\n  } ; \r\n}\r\n\r\napp.get('\/', function (req, res) { \r\n  console.log(logfmt.stringify(getSomeEnvironmentData(req, res))) \r\n  res.send('Hello World!'); \r\n});\r\n\r\napp.get('\/:name', function (req, res) { \r\n  console.log(logfmt.stringify(getSomeEnvironmentData(req, res))) \r\n  res.send('Hello World, ' + req.params.name); \r\n});\r\n\r\nvar server = app.listen(3000, function () { \r\n  var host = server.address().address; \r\n  var port = server.address().port;\r\n\r\n  console.log('Example app listening at http:\/\/%s:%s', host, port); \r\n});<\/pre>\n<p>Here I\u2019ve written a simple function, <code>getSomeEnvironmentData()<\/code>, which takes the request and response objects and composes a user-defined object that stores the <em>baseUrl<\/em>, <em>hostname<\/em>, <em>request protocol<\/em>, and the value of the <code>:name<\/code> parameter, if passed.<\/p>\n<p>In both of the defined routes, the function is called and the return value passed to <code>logfmt.stringify()<\/code>, which serializes the object to the logfmt format. This is in turn passed to <code>console.log(<\/code>) for an easy way of logging the information.<\/p>\n<p>In more sophisticated setups, you could write to log files or remote logging services, such as <a href=\"https:\/\/papertrailapp.com\/\">Papertrail<\/a> or <a href=\"http:\/\/www.splunk.com\/\">Splunk<\/a>. If you were to run the above code and make a request to either <code>\/<\/code> or to <code>\/matthew<\/code>, the following would be output to the console from which the process was initiated:<\/p>\n<pre class=\" brush:php\">baseUrl=\"\/\" hostname=localhost protocol=http\r\nbaseUrl=\"\/\" hostname=localhost protocol=http name=matthew<\/pre>\n<p>Now, in more production applications, there\u2019d likely be much more sophisticated instrumentation. This could include details about the logged in user, the dispatched route, as well as a variety of other information, about the current application\u2019s executing state. But for the purposes of a simple example, the above code works well.<\/p>\n<h2>How to Parse Logs<\/h2>\n<p>Now that we\u2019ve looked at generating logs, how do you parse them? Parsing comes down to what you\u2019ve logged, so it\u2019s hard to provide a definitive, codified answer as to how to parse them.<\/p>\n<p>However, there are a couple of tools available, <a href=\"https:\/\/github.com\/brandur\/hutils\">called hutils<\/a>. They\u2019re developed at <a href=\"https:\/\/www.heroku.com\/\">Heroku<\/a>, and they help make the process simpler. There are four tools available in the set:<\/p>\n<ul>\n<li><strong>lcut:<\/strong> Extracts values from a logfmt trace based on some field name<\/li>\n<li><strong>lfmt:<\/strong> Prettifies logfmt lines as they emerge from a stream and highlights their key sections<\/li>\n<li><strong>ltap:<\/strong> Accesses messages from popular log providers in a consistent way so that it can easily be parsed by other utilities that operate on logfmt traces.<\/li>\n<li><strong>lviz:<\/strong> Helps to visualize logfmt output by building a tree out of some set of data by combining common sets of key\/value pairs into shared parent nodes<\/li>\n<\/ul>\n<p>Let\u2019s have a look at lcut and lviz, using data logged from the earlier application. Let\u2019s assume that the application, instead of logging to the console, was logging to a file, located at <code>\/project\/root\/log\/log.file<\/code>. Also, let\u2019s assume that that file contained the following records:<\/p>\n<pre class=\" brush:php\">baseUrl=\"\/\" route=getName hostname=localhost protocol=http name=matthew\r\nbaseUrl=\"\/\" route=getName hostname=localhost protocol=http name=james\r\nbaseUrl=\"\/\" route=getName hostname=localhost protocol=http name=peter\r\nbaseUrl=\"\/\" route=getName hostname=localhost protocol=http name=roger\r\nbaseUrl=\"\/\" route=getName hostname=localhost protocol=http name=albert\r\nbaseUrl=\"\/\" route=getName hostname=localhost protocol=http name=nicholas\r\nbaseUrl=\"\/\" route=getName hostname=localhost protocol=http name=angela\r\nbaseUrl=\"\/\" route=getName hostname=localhost protocol=http name=robert<\/pre>\n<h3>lviz<\/h3>\n<p>We\u2019ll start off with lviz. I\u2019ll cat the output of the log file to lviz by using the command <code>cat log.file | lviz<\/code>. You can see the result in the screenshot below:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/lviz-screenshot.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-7828\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/lviz-screenshot.jpg\" alt=\"lviz-screenshot\" width=\"860\" height=\"385\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/lviz-screenshot.jpg 885w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/lviz-screenshot-300x134.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>You can see that each of the elements which are the same, have been output only once. However, all of the differences (e.g., the name property) have been output in a subordinate tree format. This makes it pretty simple to get a quick grasp on the information at hand.<\/p>\n<h3>lcut<\/h3>\n<p>Now let\u2019s have a look at lcut. In this scenario, I just want to extract several of the fields from the logged information. Specifically, I want to get the route and the name.<\/p>\n<p>To do so, again, I\u2019ll cat the contents of the log file to lcut and specify the columns which I want to extract: route and name. I do this with the following command: <code>cat log.file | lcut route name<\/code>. You can check out the result in the screenshot below:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/lcut-screenshot.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-7830\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/lcut-screenshot.jpg\" alt=\"lcut-screenshot\" width=\"860\" height=\"385\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/lcut-screenshot.jpg 885w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/10\/lcut-screenshot-300x134.jpg 300w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>Here, you can see, listed in the output, the two columns requested. This could then be piped to any number of other commands to perform further analysis on the data extracted.<\/p>\n<h2>What Libraries Are Available<\/h2>\n<p>Logfmt isn\u2019t that old, but there are already a number of language bindings available:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/csquared\/node-logfmt\">Node.js<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/go-logfmt\/logfmt\">Go<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/jkakar\/logfmt-python\">Python<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/cyberdelia\/logfmt-ruby\">Ruby<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/jclem\/logfmt-elixir\">Elixir<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/brandur\/logfmt\">Rust<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/aymanosman\/logfmt\">Haskell<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/tsloughter\/logfmt-erlang\">Erlang<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/yeller\/logfmt\">Clojure<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/jclem\/logfmt-dart\">Dart<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/naaman\/logfmt-java\">Java<\/a><\/li>\n<li>and a number of language frameworks, like <a href=\"https:\/\/github.com\/jmataya\/logfmt-angular\">Angular.js<\/a><\/li>\n<\/ul>\n<p>Over the coming months, I\u2019d expect to see more language bindings coming available. Alternatively, you could implement it in your desired language of choice instead of waiting, if you feel so inclined.<\/p>\n<h2>What Services Are Available<\/h2>\n<p>While the format\u2019s still relatively new, there are a number of services starting to make use of it. These include Splunk, Papertrail, and <a href=\"https:\/\/www.librato.com\">librato<\/a>. There are also plugins available for <a href=\"https:\/\/github.com\/grandcentrix\/logstash-codec-logfmt\">Logstash<\/a> and <a href=\"http:\/\/mvnrepository.com\/artifact\/com.heroku\/logfmt\/0.1\">Maven<\/a>.<\/p>\n<h2>Wrap Up<\/h2>\n<p>While logfmt isn\u2019t revolutionary in nature, it\u2019s definitely a step in the right direction for more universal, more manageable logging. If you\u2019re stuck finding a logging format or a logging approach that works for your application, definitely consider the simplicity and universality of logfmt.<\/p>\n<p>Already using it? What\u2019s your experience been with it? Share your thoughts in the comments.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.codeship.com\/logfmt-a-log-format-thats-easy-to-read-and-write\/\">Logfmt: A Log Format That&#8217;s Easy To Read and Write<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Florian Motlik at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>You don\u2019t need to be a logging expert to know that when it comes to logging in applications, there\u2019s a wide variety of options to choose from. There\u2019s the Common Log Format, the Combined Log Format, and Nginx\u2019s log format; and on and on the list goes. But are any of these really the right &hellip;<\/p>\n","protected":false},"author":119,"featured_media":927,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[262],"class_list":["post-7803","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-logfmt"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Logfmt: A Log Format That&#039;s Easy To Read and Write - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"You don\u2019t need to be a logging expert to know that when it comes to logging in applications, there\u2019s a wide variety of options to choose from. There\u2019s the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Logfmt: A Log Format That&#039;s Easy To Read and Write - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"You don\u2019t need to be a logging expert to know that when it comes to logging in applications, there\u2019s a wide variety of options to choose from. There\u2019s the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-15T09:15:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-16T09:04:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Matthew Setter\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@settermjd\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthew Setter\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/\"},\"author\":{\"name\":\"Matthew Setter\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b05e82f4b706b29d2bfb20134e3d2f35\"},\"headline\":\"Logfmt: A Log Format That&#8217;s Easy To Read and Write\",\"datePublished\":\"2015-10-15T09:15:02+00:00\",\"dateModified\":\"2015-12-16T09:04:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/\"},\"wordCount\":1200,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"keywords\":[\"Logfmt\"],\"articleSection\":[\"Web Dev\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/\",\"name\":\"Logfmt: A Log Format That's Easy To Read and Write - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"datePublished\":\"2015-10-15T09:15:02+00:00\",\"dateModified\":\"2015-12-16T09:04:47+00:00\",\"description\":\"You don\u2019t need to be a logging expert to know that when it comes to logging in applications, there\u2019s a wide variety of options to choose from. There\u2019s the\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Dev\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Logfmt: A Log Format That&#8217;s Easy To Read and Write\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b05e82f4b706b29d2bfb20134e3d2f35\",\"name\":\"Matthew Setter\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/93462db49ad0350a33d70149761702068941d2e0c07150ae8c32df9512fc2bde?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/93462db49ad0350a33d70149761702068941d2e0c07150ae8c32df9512fc2bde?s=96&d=mm&r=g\",\"caption\":\"Matthew Setter\"},\"description\":\"Matthew Setter is a developer and technical writer. He creates web-based applications and technical content that engage developers with platforms, technologies, applications, and tools.\",\"sameAs\":[\"https:\/\/x.com\/settermjd\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/matthew-setter\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Logfmt: A Log Format That's Easy To Read and Write - Web Code Geeks - 2026","description":"You don\u2019t need to be a logging expert to know that when it comes to logging in applications, there\u2019s a wide variety of options to choose from. There\u2019s the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/","og_locale":"en_US","og_type":"article","og_title":"Logfmt: A Log Format That's Easy To Read and Write - Web Code Geeks - 2026","og_description":"You don\u2019t need to be a logging expert to know that when it comes to logging in applications, there\u2019s a wide variety of options to choose from. There\u2019s the","og_url":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-10-15T09:15:02+00:00","article_modified_time":"2015-12-16T09:04:47+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","type":"image\/jpeg"}],"author":"Matthew Setter","twitter_card":"summary_large_image","twitter_creator":"@settermjd","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Matthew Setter","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/"},"author":{"name":"Matthew Setter","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b05e82f4b706b29d2bfb20134e3d2f35"},"headline":"Logfmt: A Log Format That&#8217;s Easy To Read and Write","datePublished":"2015-10-15T09:15:02+00:00","dateModified":"2015-12-16T09:04:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/"},"wordCount":1200,"commentCount":4,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","keywords":["Logfmt"],"articleSection":["Web Dev"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/","url":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/","name":"Logfmt: A Log Format That's Easy To Read and Write - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","datePublished":"2015-10-15T09:15:02+00:00","dateModified":"2015-12-16T09:04:47+00:00","description":"You don\u2019t need to be a logging expert to know that when it comes to logging in applications, there\u2019s a wide variety of options to choose from. There\u2019s the","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/web-development\/logfmt-log-format-thats-easy-read-write\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Dev","item":"https:\/\/www.webcodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Logfmt: A Log Format That&#8217;s Easy To Read and Write"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b05e82f4b706b29d2bfb20134e3d2f35","name":"Matthew Setter","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/93462db49ad0350a33d70149761702068941d2e0c07150ae8c32df9512fc2bde?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93462db49ad0350a33d70149761702068941d2e0c07150ae8c32df9512fc2bde?s=96&d=mm&r=g","caption":"Matthew Setter"},"description":"Matthew Setter is a developer and technical writer. He creates web-based applications and technical content that engage developers with platforms, technologies, applications, and tools.","sameAs":["https:\/\/x.com\/settermjd"],"url":"https:\/\/www.webcodegeeks.com\/author\/matthew-setter\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/7803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=7803"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/7803\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/927"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=7803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=7803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=7803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}