{"id":22576106,"url":"https://github.com/bnadlerjr/logfmt","last_synced_at":"2025-03-28T15:43:22.478Z","repository":{"id":57713256,"uuid":"115872357","full_name":"bnadlerjr/logfmt","owner":"bnadlerjr","description":"A Clojure library for emitting logfmt","archived":false,"fork":false,"pushed_at":"2018-01-01T23:29:19.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T15:52:33.898Z","etag":null,"topics":["clojure","logfmt","logging"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnadlerjr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-31T15:58:45.000Z","updated_at":"2019-08-01T17:28:14.000Z","dependencies_parsed_at":"2022-09-06T02:10:57.550Z","dependency_job_id":null,"html_url":"https://github.com/bnadlerjr/logfmt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnadlerjr%2Flogfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnadlerjr%2Flogfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnadlerjr%2Flogfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnadlerjr%2Flogfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnadlerjr","download_url":"https://codeload.github.com/bnadlerjr/logfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246057239,"owners_count":20716898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","logfmt","logging"],"created_at":"2024-12-08T04:06:05.624Z","updated_at":"2025-03-28T15:43:22.451Z","avatar_url":"https://github.com/bnadlerjr.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logfmt\n\nA Clojure library for emitting [logfmt](https://brandur.org/logfmt). Read the\n[annotated source](http://bobnadler.com/logfmt/) for details. See the\n[changelog](https://github.com/bnadlerjr/logfmt/blob/master/CHANGELOG.md) for\nlatest updates.\n\n[![Clojars Project](https://img.shields.io/clojars/v/bnadlerjr/logfmt.svg)](https://clojars.org/bnadlerjr/logfmt)\n[![Build Status](https://travis-ci.org/bnadlerjr/logfmt.svg?branch=master)](https://travis-ci.org/bnadlerjr/logfmt)\n\n## Quickstart\n### Install\nAdd the dependency to your `project.clj` file:\n\n```\n[bnadlerjr/logfmt \"0.1.0\"]\n```\n\n### Examples\n#### Basic Logging\n\n```clojure\n(require '[logfmt.core :as log])\n\n(log/info \"Some message text.\" {:foo 1 :bar 2 :baz 3})\n```\n\nThe above will print a message formatted like this to `STDOUT`:\n\n```\nat=info msg=\"Some message text.\" foo=1 bar=2 baz=3\n```\n\n#### Ring Middleware\nThis project also provides Ring middleware for request logging. For example:\n\n```clojure\n(ns hello-world.handler\n  (:require [compojure.core :refer :all]\n            [compojure.route :as route]\n            [logfmt.ring.middleware :refer [wrap-logger]))\n\n(defroutes app-routes\n  (GET \"/hello\" [] \"Hello World)\n  (route/not-found \"Page not found\"))\n\n(def app\n  (-\u003e app-routes\n      wrap-logger))\n```\n\nAny GET requests to `/hello` will result in two messages being logged to `STDOUT`\nlike this:\n\n```\nat=info msg=\"Started GET '/hello'\" method=GET path=\"/hello\" params={} request-id=abc123\nat=info msg=\"Completed 200 in 10ms\" method=GET path=\"/hello\" status=200 duration=10ms request-id=abc123\n```\n\n### Development Mode Logging\nBy default the var `dev-mode` is set to `false`. Setting it to `true` like so:\n\n```clojure\n(require '[logfmt.core :as log])\n\n(log/set-dev-mode! true)\n(log/info \"Some message text.\" {:foo 1 :bar 2 :baz 3})\n```\n\nwill result in messages being output in a more readable format suitable for\nlocal development.\n\n```\ninfo | Some message text. foo=1 bar=2 baz=3\n```\n\n## Development\nPre-requisites:\n\n1. [Leiningen](https://leiningen.org/)\n\nTo install a local snapshot:\n\n```\n$ lein install\n```\n\nTo push a new release to Clojars:\n\n1. Document added, removed , fixed, etc. in CHANGELOG\n1. Update the version in `project.clj`\n1. `lein doc`\n1. `git add . \u0026\u0026 git commit`\n1. `git tag -a vx.x.x -m \"Tag version x.x.x\"`\n1. `git push --tags \u0026\u0026 git push`\n1. Wait for successful TravisCI build\n1. `lein deploy clojars`\n\n### Contributing\nBug reports and pull requests are welcome on [GitHub](https://github.com/bnadlerjr/logfmt).\n\n1. Fork it\n1. Create your feature branch (`git checkout -b my-new-feature`)\n1. Commit your changes (`git commit -am 'Add some feature'`)\n1. Push to the branch (`git push origin my-new-feature`)\n1. Create new Pull Request\n\n## License\n\nCopyright © 2017-2018 Bob Nadler, Jr.\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnadlerjr%2Flogfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnadlerjr%2Flogfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnadlerjr%2Flogfmt/lists"}