{"id":22994655,"url":"https://github.com/botflux/pino-logfmt","last_synced_at":"2026-03-01T19:00:59.250Z","repository":{"id":227086024,"uuid":"770406332","full_name":"botflux/pino-logfmt","owner":"botflux","description":"Logfmt transport for pino","archived":false,"fork":false,"pushed_at":"2026-02-18T08:10:27.000Z","size":1144,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-18T12:51:04.408Z","etag":null,"topics":["logfmt","logging","pino","transport"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pino-logfmt","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/botflux.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-03-11T13:54:08.000Z","updated_at":"2026-02-18T08:10:24.000Z","dependencies_parsed_at":"2025-10-26T18:09:56.806Z","dependency_job_id":"9a236c3d-0aea-4ec5-b67a-1f3b52c16685","html_url":"https://github.com/botflux/pino-logfmt","commit_stats":null,"previous_names":["botflux/pino-logfmt"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/botflux/pino-logfmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botflux%2Fpino-logfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botflux%2Fpino-logfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botflux%2Fpino-logfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botflux%2Fpino-logfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/botflux","download_url":"https://codeload.github.com/botflux/pino-logfmt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botflux%2Fpino-logfmt/sbom","scorecard":{"id":1240529,"data":{"date":"2025-12-16T09:08:57Z","repo":{"name":"github.com/botflux/pino-logfmt","commit":"96ade705bd21c94de509567ce1f2c7358ce8c648"},"scorecard":{"version":"v5.1.1","commit":"cd152cb6742c5b8f2f3d2b5193b41d9c50905198"},"score":6.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":9,"reason":"dependency not pinned by hash detected -- score normalized to 9","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/scorecard.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/botflux/pino-logfmt/scorecard.yml/main?enable=pin","Info:   8 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":10,"reason":"26 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#code-review"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#dependency-update-tool"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/on-main.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/publish.yml:11","Warn: no topLevel permission defined: .github/workflows/on-main.yml:1","Warn: no topLevel permission defined: .github/workflows/on-pr.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#token-permissions"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:7"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#cii-best-practices"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":4,"reason":"SAST tool is not run on all commits -- score normalized to 4","details":["Warn: 8 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#sast"}},{"name":"Branch-Protection","score":8,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'main'","Info: 'stale review dismissal' is required to merge on branch 'main'","Warn: required approving review count is 1 on branch 'main'","Warn: codeowners review is required - but no codeowners file found in repo","Info: 'last push approval' is required to merge on branch 'main'","Info: 'up-to-date branches' is required to merge on branch 'main'","Info: status check found to merge onto on branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#license"}},{"name":"Contributors","score":0,"reason":"project has 0 contributing companies or organizations -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#contributors"}},{"name":"CI-Tests","score":8,"reason":"8 out of 9 merged PRs checked by a CI test -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-12-19T14:01:54.576Z","repository_id":227086024,"created_at":"2025-12-19T14:01:54.576Z","updated_at":"2025-12-19T14:01:54.576Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29980767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["logfmt","logging","pino","transport"],"created_at":"2024-12-15T05:19:38.882Z","updated_at":"2026-03-01T19:00:59.228Z","avatar_url":"https://github.com/botflux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pino-logfmt\n![build and test](https://github.com/botflux/pino-logfmt/actions/workflows/on-main.yml/badge.svg)\n![tested Node.js versions](https://img.shields.io/badge/Tested_on_Node.js-20,22,24-green)\n\nThis package provides a transport that transforms standard pino logs to logfmt.\n\nA standard Pino log line like: \n\n```\n{\"level\":30,\"time\":1522431328992,\"msg\":\"hello world\",\"pid\":42,\"hostname\":\"foo\",\"v\":1}\n```\n\nWill format to:\n\n```\nlevel=30 time=1522431328992 msg=\"hello world\" pid=42 hostname=foo v=1\n```\n\n## Install\n\n```shell\nnpm install pino-logfmt\n```\n\n## Example\n\nUsing the [example script](https://github.com/pinojs/pino/blob/25ba61f40ea5a1a753c85002812426d765da52a4/examples/basic.js) from the Pino module, we can see what the prettified logs will look like:\n\n```shell\nnode examples/basic.js | pino-logfmt --flatten-nested --snake-case\nlevel=30 time=1710427304769 pid=78824 hostname=MacBook-Pro-de-Victor-2.local msg=\"hello world\"\nlevel=50 time=1710427304769 pid=78824 hostname=MacBook-Pro-de-Victor-2.local msg=\"this is at error level\"\nlevel=30 time=1710427304769 pid=78824 hostname=MacBook-Pro-de-Victor-2.local msg=\"the answer is 42\"\nlevel=30 time=1710427304769 pid=78824 hostname=MacBook-Pro-de-Victor-2.local obj=42 msg=\"hello world\"\nlevel=30 time=1710427304769 pid=78824 hostname=MacBook-Pro-de-Victor-2.local obj=42 b=2 msg=\"hello world\"\nlevel=30 time=1710427304769 pid=78824 hostname=MacBook-Pro-de-Victor-2.local nested_obj=42 msg=nested\nlevel=50 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local err_type=Error err_message=\"an error\" err_stack=\"Error: an error\n    at Object.\u003canonymous\u003e (/Users/victor/Documents/projects/pino-logfmt/node_modules/pino/examples/basic.js:21:12)\n    at Module._compile (node:internal/modules/cjs/loader:1256:14)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n    at Module.load (node:internal/modules/cjs/loader:1119:32)\n    at Module._load (node:internal/modules/cjs/loader:960:12)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\n    at node:internal/main/run_main_module:23:47\" msg=\"an error\"\nlevel=30 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local a=property msg=\"hello child!\"\nlevel=30 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local a=property another=property msg=\"hello baby..\"\nlevel=20 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local msg=\"this is a debug statement\"\nlevel=20 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local another=property msg=\"this is a debug statement via child\"\nlevel=10 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local msg=\"this is a trace statement\"\nlevel=20 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local msg=\"this is a \\\"debug\\\" statement with \\\"\"\nlevel=30 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local err_type=Error err_message=kaboom err_stack=\"Error: kaboom\n    at Object.\u003canonymous\u003e (/Users/victor/Documents/projects/pino-logfmt/node_modules/pino/examples/basic.js:40:11)\n    at Module._compile (node:internal/modules/cjs/loader:1256:14)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n    at Module.load (node:internal/modules/cjs/loader:1119:32)\n    at Module._load (node:internal/modules/cjs/loader:960:12)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\n    at node:internal/main/run_main_module:23:47\" msg=kaboom\nlevel=30 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local\nlevel=30 time=1710427304770 pid=78824 hostname=MacBook-Pro-de-Victor-2.local err_type=Error err_message=kaboom err_stack=\"Error: kaboom\n    at Object.\u003canonymous\u003e (/Users/victor/Documents/projects/pino-logfmt/node_modules/pino/examples/basic.js:43:11)\n    at Module._compile (node:internal/modules/cjs/loader:1256:14)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n    at Module.load (node:internal/modules/cjs/loader:1119:32)\n    at Module._load (node:internal/modules/cjs/loader:960:12)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\n    at node:internal/main/run_main_module:23:47\" msg=with\nlevel=30 time=1710427304771 pid=78824 hostname=MacBook-Pro-de-Victor-2.local msg=\"after setImmediate\"\n```\n\n## Programmatic usage\n\n```javascript\nconst pino = require(\"pino\")\n\nconst logger = pino({\n    transport: {\n        target: \"pino-logfmt\",\n        options: {\n            flattenNestedObjects: true,\n            convertToSnakeCase: true,\n        }\n    }\n})\n\nlogger.info(\"Hello world\")\n```\n\n### Options\n\n| Name                     | Type               | Default         | Description                                                                                                                                                   |\n|--------------------------|--------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `includeLevelLabel`      | `boolean`          | `false`         | Add the level as a label in each log entries                                                                                                                  |\n| `levelLabelKey`          | `string`           | `\"level_label\"` | The name of the level label metadata. Only used if `includeLevelLabel` is enabled.                                                                            |\n| `formatTime`             | `boolean`          | `false`         | Format pino's `time` field using Date.toISOString(). The `time` field will be overriden with the formatted date.                                              |\n| `timeFormat`             | `string`           | `\"isoDateTime\"` | A time format compatible with `dateformat`' formats.                                                                                                          |\n| `timeKey`                | `string`           | `\"time\"`        | The name of the key that holds the log timestamp.                                                                                                             |\n| `convertToSnakeCase`     | `boolean`          | `false`         | Convert log field names to snake case.                                                                                                                        |\n| `flattenNestedObjects`   | `boolean`          | `false`         | Flatten nested metadata (e.g. `{ error: { type: \"Error\", message: \"Something went wrong\" } }` becomes `error_type=Error error_message=\"Something went wrong\"` |\n| `flattenNestedSeparator` | `string`           | `\"_\"`           | The character that is used to merge keys when `flattenNestedObjects` is enabled.                                                                              |\n| `escapeMultilineStrings` | `boolean`           | `false`           | Escape multi-line strings in the log output, including deeply nested values                                                                              |\n| `destination`            | `string \\| number` | `1`             | The destination where the transport will write to. By default, it logs to stdout but you can also provide a file name.                                        |\n\n\n## CLI usage\n\nThe transport is also available using a CLI through. Almost all the options are available as CLI arguments.\nLike other CLIs, you can print the help message using `--help` as followed:\n\n```shell\nnpx pino-logfmt --help\n\nUsage: pino-logfmt [options]\n\nLogfmt transport for pino\n\nOptions:\n  -V, --version                 output the version number\n  --include-level-label         add the level as a label (default: false)\n  --level-label-key \u003cstring\u003e    the key of the level label (default: \"level_label\")\n  --format-time                 format the timestamp into an ISO date (default: false)\n  --time-key \u003cstring\u003e           the key that holds the timestamp (default: \"time\")\n  --snake-case                  convert the keys to snake case (default: false)\n  --flatten-nested              flatten nested metadata (default: false)\n  --flatten-separator \u003cstring\u003e  the separator used when flattening nested metadata (default: \".\")\n  --custom-levels, -x \u003cstring\u003e  the levels associated to their labels in the format \"10:trace,20:debug\" (default: \"10:trace,20:debug,30:info,40:warn,50:error,60:fatal\")\n  --time-format \u003cstring\u003e        the time format to use if time formatting is enabled (default: \"isoDateTime\")\n  --escape-multiline-strings    escape multi-line strings in the log output, including deeply nested values (default: false)\n  -h, --help                    display help for command\n```\n\n```shell\nnode process-that-emits-logs.js | pino-logfmt\n```\n\n### Flags\n\n| Name                    | Type      | Default         | Description                                                                                                                                                   |\n|-------------------------|-----------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `--include-level-label` | `boolean` | `false`         | Add the level as a label in each log entries                                                                                                                  |\n| `--level-label-key`     | `string`  | `\"level_label\"` | The name of the level label metadata. Only used if `includeLevelLabel` is enabled.                                                                            |\n| `--format-time`         | `boolean` | `false`         | Format pino's `time` field using Date.toISOString(). The `time` field will be overriden with the formatted date.                                              |\n| `--time-format`         | `string`  | `\"isoDateTime\"` | A time format compatible with `dateformat`' formats.                                                                                                          |\n| `--time-key`            | `string`  | `\"time\"`        | The name of the key that holds the log timestamp.                                                                                                             |\n| `--snake-case`          | `boolean` | `false`         | Convert log field names to snake case.                                                                                                                        |\n| `--escape-multiline-strings`          | `boolean` | `false`         | Escape multi-line strings in the log output, including deeply nested values                                               |\n| `--flatten-nested`      | `boolean` | `false`         | Flatten nested metadata (e.g. `{ error: { type: \"Error\", message: \"Something went wrong\" } }` becomes `error_type=Error error_message=\"Something went wrong\"` |\n| `--flatten-separator`   | `string`  | `\"_\"`           | The character that is used to merge keys when `flattenNestedObjects` is enabled.                                                                              |\n\n## Contributing\n\nTo get started, you must clone the project and install dependencies.\nThen, you can use `devbox` to start the default environment.\n\n```shell\ngit clone git@github.com:botflux/pino-logfmt.git\nnpm ci\ndevbox shell\n```\n\nCode is linted in commit using `lint-staged`. The linter is `standard`.\nYou can run the linter before commiting using `npm run lint`.\n\nThe project is tested using `node:test`. Run `npm run test` to run the tests.\n\n## Migrating from v0 to v1\n\nNo API changed from v0 to v1, only support for Node.js 14, 16 and 18 was dropped.\n\nNode.js 14 and 16 were dropped because the package now uses `node:util`'s `parseArgs`\nfunction instead of `commander` (thus reducing the package's size).\n\nOn the other hand, Node.js 18 was dropped because it reached its end of life.\nThis means that the project can still work under this major, but there is no automated\ntest ensuring it fully works.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotflux%2Fpino-logfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbotflux%2Fpino-logfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotflux%2Fpino-logfmt/lists"}