{"_id":"@beautinique/backend-logger","_rev":"7-dab0dc431cdf3c083749c1c3aec10b41","name":"@beautinique/backend-logger","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@beautinique/backend-logger","version":"1.0.0","keywords":["backend","logger","pino","pino-http","pino-pretty","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-logger@1.0.0","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/logger#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"23655c06ca7aaca145263e54427146efeb5599b5","tarball":"https://registry.npmjs.org/@beautinique/backend-logger/-/backend-logger-1.0.0.tgz","fileCount":8,"integrity":"sha512-3hmuJgGubtEoCvO0nsrCHJ8WEVG0jUcguTgg3sX8s3c9xcIFlDt8ialC4rl/qJWo6Yk9JWriD1H8JM0rPnju2A==","signatures":[{"sig":"MEQCIDO/Kln6VElFYBkc61ddFuSGho6mNVbEhqH91FhnIuPWAiBTm9EbvIAw718ovLoLMw2A2B2CX7lJf2KwzkJRIhDJaQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":144009},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"b2feeb4d188b9739eee7dae17dd33eef5d8d3559","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/logger"},"_npmVersion":"11.8.0","description":"Backend Logger for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"pino":"^10.3.1","pino-http":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.0","typescript":"^6.0.3","@types/node":"^26.1.0","pino-pretty":"^13.1.3"},"peerDependencies":{"pino-pretty":">=13"},"peerDependenciesMeta":{"pino-pretty":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/backend-logger_1.0.0_1783412222614_0.17942733691034363","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@beautinique/backend-logger","version":"1.0.1","keywords":["backend","logger","pino","pino-http","pino-pretty","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-logger@1.0.1","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/logger#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"b277e9c60b03a8e92c37c880ae2d353d54127328","tarball":"https://registry.npmjs.org/@beautinique/backend-logger/-/backend-logger-1.0.1.tgz","fileCount":8,"integrity":"sha512-c7u6kdjz12UxAJzpteLh3Tc9oWk+gXsCf3wnCK9CDZoXz5CjYQPCqZm624H2NC42xVVtemL4TlnTB1KMfkPbsA==","signatures":[{"sig":"MEYCIQC/Y3zIsP13wL2Q2UJQB/rSGJXwHVUK7iTBeS43fiBSKgIhAN4PLH2Z80S1BAVb2LH9Haj6QGowhCXQYAuRTKBJAnkC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":134327},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"f6b33279ced972caf3b936a3e0df03d254897a4f","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/logger"},"_npmVersion":"11.8.0","description":"Backend Logger for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"pino":"^10.3.1","pino-http":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.0","typescript":"^6.0.3","@types/node":"^26.1.0","pino-pretty":"^13.1.3"},"peerDependencies":{"pino-pretty":">=13"},"peerDependenciesMeta":{"pino-pretty":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/backend-logger_1.0.1_1783421516417_0.930836894348376","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@beautinique/backend-logger","version":"1.0.2","keywords":["backend","logger","pino","pino-http","pino-pretty","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-logger@1.0.2","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/logger#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"c0fb5f24167299dfd94bdaa3eeb5781ac9d54d98","tarball":"https://registry.npmjs.org/@beautinique/backend-logger/-/backend-logger-1.0.2.tgz","fileCount":8,"integrity":"sha512-hPVllP8qthr0T62dkJF2Q4p+bXoQ5fmcQqhej2WKXVW/Dlh6oB8fz9IvdAHrs0kzmjOnpnCUgiwZ7Dt4M1Zp7g==","signatures":[{"sig":"MEYCIQDoBLaL3nt0EbmR0P++bqhUEQoPZpS3Kz0LgTIBqVmGCwIhALywsR/8tBS7zbnNHeO1eoxHwN3egdM0P60SvqjrkRkQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":137014},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"f6b33279ced972caf3b936a3e0df03d254897a4f","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/logger"},"_npmVersion":"11.8.0","description":"Backend Logger for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"pino":"^10.3.1","pino-http":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.0","typescript":"^6.0.3","@types/node":"^26.1.0","pino-pretty":"^13.1.3"},"peerDependencies":{"pino-pretty":">=13"},"peerDependenciesMeta":{"pino-pretty":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/backend-logger_1.0.2_1783422390887_0.014805981262327794","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@beautinique/backend-logger","version":"1.0.3","keywords":["backend","logger","pino","pino-http","pino-pretty","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-logger@1.0.3","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/logger#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"2e5c9a51962601094801670fe489881a3230b956","tarball":"https://registry.npmjs.org/@beautinique/backend-logger/-/backend-logger-1.0.3.tgz","fileCount":122,"integrity":"sha512-FyK2lKhRJxPgO3ItbsqzT8EhUIXi2DQ19jGljLLYrqwyyygbaSpien4OuCEWq2zbYtIqt5gjAyyinLYH+9b1Fg==","signatures":[{"sig":"MEUCIQDI7s9wBy6EwuguI0tt/bRV01S67fukidB/PvUPnfZJkAIgf3svoS6mK7mOpjT1+9h8pSUbwBGho8TjqJe1r4ZFDm8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":202640},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"e30737149d6d3916e61a909d2a30954882a1ce7e","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/logger"},"_npmVersion":"11.8.0","description":"Backend Logger for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"pino":"^10.3.1","pino-http":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.0","typescript":"^6.0.3","@types/node":"^26.1.0","pino-pretty":"^13.1.3"},"peerDependencies":{"pino-pretty":">=13"},"peerDependenciesMeta":{"pino-pretty":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/backend-logger_1.0.3_1785442776981_0.10147536374836941","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@beautinique/backend-logger","version":"1.0.4","keywords":["backend","logger","pino","pino-http","pino-pretty","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-logger@1.0.4","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/logger#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"1b8641e3a0e04ea5dae8d8340a9c454aafc8f03b","tarball":"https://registry.npmjs.org/@beautinique/backend-logger/-/backend-logger-1.0.4.tgz","fileCount":122,"integrity":"sha512-2ok3yOeWrhPedYIYj0bb7YhHXBsrS/4BGyMUtWCo43m4DajnTgYD3QUqEKVu36opilzqTw17PuoCRQ0Yg68xeA==","signatures":[{"sig":"MEUCIQCqxwwwa+Rssm7XE8U/WGqZavs2c7KbLglFoKTnZy9tGAIgZotDrBQ0BpZlljbVo33c/sYRCmNG4mRF5DoUrTUneOg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":206049},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"b026a3b9693c94e58dcd163010dbf39b6b79e7ea","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/logger"},"_npmVersion":"11.8.0","description":"Backend Logger for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"pino":"^10.3.1","pino-http":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.0","typescript":"^6.0.3","@types/node":"^26.1.0","pino-pretty":"^13.1.3"},"peerDependencies":{"pino-pretty":">=13"},"peerDependenciesMeta":{"pino-pretty":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/backend-logger_1.0.4_1787039156198_0.015409053143195406","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@beautinique/backend-logger","version":"1.0.5","keywords":["backend","logger","pino","pino-http","pino-pretty","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-logger@1.0.5","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/logger#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"d1ae67f6945b985f629dd727b19389c2f0bdaa61","tarball":"https://registry.npmjs.org/@beautinique/backend-logger/-/backend-logger-1.0.5.tgz","fileCount":122,"integrity":"sha512-Fm/gpIKOA3c/0veG1nMjAtpsA+7X9LURClMrYpXErhGK7UgzZJdAW0n40VjSeXEg+p6uvLNLnCXGp94qyHpyGA==","signatures":[{"sig":"MEYCIQDOF0iu4y+GQ1ToFuqMeh+Ms4aUTePAQFTVphoR8OwEEQIhALTtgBNr8/PMQzjXrQC9xU1kLhrlKXmdsUGiJ5RL+8PT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":206049},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"2807c53a8d389b6f0a36770b416bcc2026e40ca2","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/logger"},"_npmVersion":"11.10.1","description":"Backend Logger for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"pino":"^10.3.1","pino-http":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.0","typescript":"^6.0.3","@types/node":"^26.1.0","pino-pretty":"^13.1.3"},"peerDependencies":{"pino-pretty":">=13"},"peerDependenciesMeta":{"pino-pretty":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/backend-logger_1.0.5_1787219412519_0.37423887874409","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@beautinique/backend-logger","version":"1.0.6","description":"Backend Logger for Beautinique project.","keywords":["backend","logger","pino","pino-http","pino-pretty","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","directory":"packages/backend/logger"},"bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/logger#readme","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","dev":"tsup --watch","lint":"eslint .","typecheck":"tsc --noEmit"},"publishConfig":{"access":"public"},"engines":{"node":">=24"},"peerDependencies":{"pino-pretty":">=13"},"peerDependenciesMeta":{"pino-pretty":{"optional":true}},"devDependencies":{"@types/node":"^26.1.0","pino-pretty":"^13.1.3","tsx":"^4.23.0","typescript":"^6.0.3"},"dependencies":{"pino":"^10.3.1","pino-http":"^11.0.0"},"gitHead":"3a5103fb9030969e849b1e69b02bbe7d1cab5fbe","_id":"@beautinique/backend-logger@1.0.6","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-+lhkfEFbQEV3qMBGuQ+zJ65OMMY4nOjAXUV5+m1P5UHoAT5yKc8SLuHs3BHTLONu24VCtU+9c8BR+kBboqobjw==","shasum":"176e83cc67c5c9b6c017469efd2c1f0dba7eb056","tarball":"https://registry.npmjs.org/@beautinique/backend-logger/-/backend-logger-1.0.6.tgz","fileCount":122,"unpackedSize":206049,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA5PM+eMGzFkfDnAd5Kvvzqzmhn4DDqoMj/dqjUIArTnAiEAhi9wywBNPGOgPnRW/q7njK46I9jVQZEY09wqDOl1ry4="}]},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"directories":{},"maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/backend-logger_1.0.6_1787576744434_0.9934086664257673"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-07T08:17:02.462Z","modified":"2026-08-24T13:05:44.774Z","1.0.0":"2026-07-07T08:17:02.761Z","1.0.1":"2026-07-07T10:51:56.568Z","1.0.2":"2026-07-07T11:06:31.079Z","1.0.3":"2026-07-30T20:19:37.147Z","1.0.4":"2026-08-18T07:45:56.341Z","1.0.5":"2026-08-20T09:50:12.675Z","1.0.6":"2026-08-24T13:05:44.596Z"},"bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"author":{"name":"Nageshwar Pawar"},"license":"MIT","homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/logger#readme","keywords":["backend","logger","pino","pino-http","pino-pretty","beautinique"],"repository":{"type":"git","url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","directory":"packages/backend/logger"},"description":"Backend Logger for Beautinique project.","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"readme":"# @beautinique/backend-logger\r\n\r\nFramework-agnostic, production-ready logging for Beautinique backend services and microservices, built on [Pino](https://getpino.io) and [pino-http](https://github.com/pinojs/pino-http).\r\n\r\n- Secure by default - credentials, tokens, and cookies are always redacted, in every environment.\r\n- Fast - raw JSON to `stdout` in production, no unnecessary allocations or blocking I/O.\r\n- One shape everywhere - the same request/response/error serializers and log-level mapping across every service, so Loki/Grafana queries stay consistent.\r\n- Works anywhere - CLIs, workers, cron jobs, background queues, and HTTP servers (Express, Fastify, or plain `node:http`).\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @beautinique/backend-logger\r\n```\r\n\r\nIf you want human-readable output in development (`pretty: true`), also install `pino-pretty` in the service that needs it:\r\n\r\n```bash\r\nnpm install -D pino-pretty\r\n```\r\n\r\n`pino-pretty` is an optional peer dependency - it is only ever loaded when `pretty` is enabled, so production installs don't pay for it.\r\n\r\n\r\n## Core logger - `createLogger`\r\n\r\n`createLogger` returns a fully configured Pino `Logger`. Use it anywhere - HTTP servers, CLIs, workers, cron jobs, background queues:\r\n\r\n```ts\r\nconst logger = createLogger({\r\n  service: 'orders-worker',\r\n  pretty: true,\r\n  context: { region: 'ap-south-1' }, // extra static fields on every log line\r\n});\r\n\r\nlogger.info('Worker started');\r\nlogger.error({ err: someError }, 'Job failed');\r\n```\r\n\r\n| Option    | Default                         | Description                                                                                                      |\r\n| --------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------- |\r\n| `service` | _(required)_                    | Tags every log line - use this to filter/group logs per service in Grafana.                                      |\r\n| `pretty`  | `process.env.IS_DEV === 'true'` | Human-readable, colorized output via `pino-pretty`. Also controls whether error stack traces are included.       |\r\n| `context` | `undefined`                     | Extra static fields merged into every log line.                                                                  |\r\n| `logsDir` | `undefined`                     | Additionally write logs to files in this directory, split by category (see \"File logging\" below).                |\r\n| `redact`  | `undefined`                     | Extra redact paths, additively merged with the built-in secure defaults (see below). Cannot remove the defaults. |\r\n| ...       |                                 | Any other native Pino `LoggerOptions` (`level`, `formatters`, `hooks`, ...) are passed straight through.         |\r\n\r\n## HTTP logger - `createHttpLogger`\r\n\r\n`createHttpLogger` returns `pino-http` middleware. It is intentionally **independent** from `createLogger`'s own configuration (it has its own `pretty`/body-logging behaviour) while writing through the same Pino instance you pass it:\r\n\r\n```ts\r\nconst logger = createLogger({ service: 'gateway' });\r\n\r\napp.use(\r\n  createHttpLogger({\r\n    logger,\r\n    ignorePaths: ['/metrics'], // merged with the default ignore list\r\n  }),\r\n);\r\n```\r\n\r\n| Option                                                                               | Default                         | Description                                                                                                                |\r\n| ------------------------------------------------------------------------------------ | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |\r\n| `logger`                                                                             | _(required)_                    | The Pino instance to attach request/response logs to.                                                                      |\r\n| `pretty`                                                                             | `process.env.IS_DEV === 'true'` | Enables development-only behaviour (currently: logging the parsed request body).                                           |\r\n| `ignorePaths`                                                                        | `undefined`                     | Extra paths to exclude from auto-logging, merged with `/health`, `/favicon.ico`, `/robots.txt`.                            |\r\n| `autoLogging`                                                                        | enabled                         | Pass `false` to disable entirely, or `{ ignore }` - your predicate is combined with the default ignore list, not replaced. |\r\n| `customProps` / `customReceivedObject` / `customSuccessObject` / `customErrorObject` | -                               | If supplied, merged on top of this package's own structured output (e.g. `requestId`) rather than replacing it.            |\r\n\r\nAlways enforced (not configurable), so every service produces the same log shape:\r\n\r\n- **Request ID**: reuses an inbound `x-request-id` header, or generates one with `crypto.randomUUID()`. Available as `requestId` on every request/success/error log line.\r\n- **Log level mapping**: 2xx/3xx → `info`, 4xx → `warn`, 5xx or an unhandled error → `error`.\r\n- **Serializers**: the secure request/response/error serializers described below.\r\n- **Success message format**: `\"Request completed with status <code>\"`.\r\n\r\n## File logging\r\n\r\nBy default, logs only go to `stdout` (see \"Where do logs go?\" below). Passing `logsDir` additionally writes them to files in that directory, split into four categories:\r\n\r\n```ts\r\nconst logger = createLogger({\r\n  service: 'gateway',\r\n  logsDir: 'logs', // created automatically if missing\r\n});\r\n```\r\n\r\n| File            | Contents                                                                                                     |\r\n| --------------- | -------------------------------------------------------------------------------------------------------------- |\r\n| `request.log`   | Every HTTP request/response log line (from `createHttpLogger`), regardless of outcome - a full traffic trail. |\r\n| `error.log`     | Every `error`/`fatal` level log line - including request-tied ones, so it's a complete error feed on its own.  |\r\n| `warning.log`   | Every `warn` level log line - including request-tied ones (e.g. 4xx responses).                                |\r\n| `success.log`   | Everything else (`info`/`debug`/`trace`) that is **not** already part of an HTTP request - plain application messages, so this file doesn't get flooded with routine request traffic. |\r\n\r\nThis is intentionally simple - plain append-only file streams, no rotation or worker threads. For log rotation, shipping to Loki, etc., see the roadmap in the package description.\r\n\r\n### Where do logs go by default?\r\n\r\nWithout `logsDir`, this package only ever writes to `stdout` (colorized in development, raw JSON in production) - it does not persist logs anywhere by itself. Persisting/collecting logs long-term is normally handled by your deployment infrastructure: a container runtime captures `stdout`, a shipper (Promtail/Fluent Bit/Grafana Agent) forwards it to Loki, and Grafana queries Loki. `logsDir` exists for simple local/file-based persistence when that infrastructure isn't in place yet.\r\n\r\n## Serializers\r\n\r\n- **Request** - `id`, `method`, `url`, `query`, `params`, `ip`, `remoteAddress`, `remotePort`, `userAgent`. Raw headers are never included. `body` is only included when `pretty` is enabled.\r\n- **Response** - `statusCode` only.\r\n- **Error** - recursively serializes `Error.cause` chains and `AggregateError.errors`, is circular-reference safe (via a `WeakSet` recursion guard), and never throws - any thrown value (not just `Error` instances) is normalized into one first. Stack traces are stripped unless `pretty` is enabled.\r\n\r\n## Redaction\r\n\r\nThese paths are always redacted, in every environment, and cannot be disabled - only extended via the `redact` option:\r\n\r\n- `req.headers.authorization`, `req.headers.cookie`, `req.headers[\"x-api-key\"]`\r\n- `password`, `confirmPassword`, `token`, `accessToken`, `refreshToken` - at the top level, and under `body.*` / `req.body.*` (where a logged request body ends up nested).\r\n\r\n```ts\r\ncreateLogger({\r\n  service: 'gateway',\r\n  redact: { paths: ['user.ssn'] }, // merged with the defaults above\r\n});\r\n```\r\n\r\n## Repository\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages\r\n\r\n## Homepage\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages\r\n\r\n## Issues\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages/issues\r\n\r\n## Author\r\n\r\nNageshwar Pawar\r\n\r\n## License\r\n\r\nThis package is licensed under the MIT License. See the root `LICENSE` file for details.\r\n","readmeFilename":"README.md"}