{"id":19075831,"url":"https://github.com/secomind/plug_logger_with_meta","last_synced_at":"2026-03-11T19:08:24.326Z","repository":{"id":57534781,"uuid":"218064363","full_name":"secomind/plug_logger_with_meta","owner":"secomind","description":"Plug.Logger replacement focused on metadata logging. ","archived":false,"fork":false,"pushed_at":"2019-10-29T09:02:57.000Z","size":21,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-18T01:15:37.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secomind.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-10-28T14:21:40.000Z","updated_at":"2024-01-25T07:49:52.000Z","dependencies_parsed_at":"2022-09-26T18:21:37.852Z","dependency_job_id":null,"html_url":"https://github.com/secomind/plug_logger_with_meta","commit_stats":null,"previous_names":["ispirata/plug_logger_with_meta"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/secomind/plug_logger_with_meta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secomind%2Fplug_logger_with_meta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secomind%2Fplug_logger_with_meta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secomind%2Fplug_logger_with_meta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secomind%2Fplug_logger_with_meta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secomind","download_url":"https://codeload.github.com/secomind/plug_logger_with_meta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secomind%2Fplug_logger_with_meta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30395149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T18:46:22.935Z","status":"ssl_error","status_checked_at":"2026-03-11T18:46:17.045Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T01:56:07.281Z","updated_at":"2026-03-11T19:08:24.307Z","avatar_url":"https://github.com/secomind.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PlugLoggerWithMeta\n\nPlugLoggerWithMeta is a [Plug.Logger](https://hexdocs.pm/plug/Plug.Logger.html) based on Plug.Logger code, focused on metadata logging.\n\n## Why\nPlug.Logger does not use [Logger metadata](https://hexdocs.pm/logger/Logger.html#module-metadata),\nso some useful information such as `method` and `request_path` are embedded into the log message\nhence they must be scraped.\n\nPlugLoggerWithMeta makes them machine readable by exporting them using standard Logger metadata mechanisms.\n\nThere are also other similar libraries, however this tries to behave as close as possible to `Plug.Logger`.\n\n## Installation\n- Add `:plug_logger_with_meta` dependency to your project's `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:plug_logger_with_meta, \"~\u003e 0.1\"}\n  ]\nend\n```\n- Run `mix deps.get`\n\n- Replace `Plug.Logger` with `PlugLoggerWithMeta`:\n\n```diff\n--- a/endpoint.ex\n+++ b/endpoint.ex\n@@ -38,7 +38,7 @@ defmodule MyProject.APIWeb.Endpoint do\n   end\n \n   plug Plug.RequestId\n-  plug Plug.Logger\n+  plug PlugLoggerWithMeta\n```\n\n- Add relevant metadata to your logger configuration:\n\n```elixir\n config :logger, :console, format: \"[$level] $message\\n\"\n+  metadata: [\n+    :method,\n+    :request_path,\n+    :status_code,\n+    :elapsed,\n+  ]\n```\n\n- Optional: use it with [pretty_log](https://github.com/ispirata/pretty_log) (or any other logger formatter/backend)\n\n`pretty_log` will format all metadata using logfmt.\n\n## Available Metadata\n\n- elapsed (e.g. `22ms`)\n- method (e.g. `GET`)\n- request_path (e.g. `/v1/my/path`)\n- status_code (e.g. `200`)\n- tag (e.g. `got_client_req`, `sent_reply`)\n\n## About This Project\n\nThis project has been created in order to provide better logs in [Astarte](https://github.com/astarte-platform/astarte).\nWe are open to any contribution and we encourage adoption of this library, also outside Astarte, in order to provide better logs to everyone.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecomind%2Fplug_logger_with_meta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecomind%2Fplug_logger_with_meta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecomind%2Fplug_logger_with_meta/lists"}