{"_id":"@diamir/nestjs-logger","_rev":"4-253201d55c5556ba52db08e3a7e8c9bc","name":"@diamir/nestjs-logger","dist-tags":{"latest":"11.0.3-beta.0"},"versions":{"11.0.0":{"name":"@diamir/nestjs-logger","version":"11.0.0","keywords":[],"author":{"name":"Backend","email":"backend@diamir.io"},"license":"ISC","_id":"@diamir/nestjs-logger@11.0.0","maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"dist":{"shasum":"2bd53e2e8c14d90efb014118de99c4bc49056862","tarball":"https://registry.npmjs.org/@diamir/nestjs-logger/-/nestjs-logger-11.0.0.tgz","fileCount":21,"integrity":"sha512-mJ2H7m2+kmnDruwU/k3+wIP+5JjtCefPruojcl0zQoIApokELp+uX232mIhDC53yOaQWlfpj0AhREeG0+CB7yQ==","signatures":[{"sig":"MEQCIFp455ckJPJYT5cBKGycMmYTA0psNauluItVukrFa9TuAiBggYEkxwBIv9To86eiw6PZguucsE+uw2zi8Eu0q9joPw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15647},"main":"./src/index.js","type":"commonjs","_from":"file:diamir-nestjs-logger-11.0.0.tgz","types":"./src/index.d.ts","engines":{"node":">= 20"},"_npmUser":{"name":"ws-admin","email":"backend@webundsoehne.com"},"_resolved":"/tmp/ade065ab827c9955e089b8a39efc8026/diamir-nestjs-logger-11.0.0.tgz","_integrity":"sha512-mJ2H7m2+kmnDruwU/k3+wIP+5JjtCefPruojcl0zQoIApokELp+uX232mIhDC53yOaQWlfpj0AhREeG0+CB7yQ==","repository":{"url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git","type":"git"},"_npmVersion":"10.9.2","description":"<p align=\"center\">   <a href=\"https://webundsoehne.com\" target=\"blank\">     <img src=\"https://webundsoehne.com/wp-content/uploads/webundsoehne-logo.png\" width=\"320\" alt=\"Web und Söhne - Logo\" />   </a> </p> Web & Söhne is Austria's leading expert in progr","directories":{},"_nodeVersion":"22.13.1","dependencies":{"winston":"3.19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"nestjs-cls":">= 5.0.0","@nestjs/common":">= 11.0.0"},"peerDependenciesMeta":{"nestjs-cls":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/nestjs-logger_11.0.0_1778592751766_0.7906848402587985","host":"s3://npm-registry-packages-npm-production"}},"11.0.1":{"name":"@diamir/nestjs-logger","version":"11.0.1","keywords":["diamir","nestjs","logger","logging","winston"],"author":{"name":"Backend","email":"backend@diamir.io"},"license":"ISC","_id":"@diamir/nestjs-logger@11.0.1","maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"dist":{"shasum":"1cbcf52dcf64981151f1f6b41ee4090da3ab4157","tarball":"https://registry.npmjs.org/@diamir/nestjs-logger/-/nestjs-logger-11.0.1.tgz","fileCount":21,"integrity":"sha512-UD5QZ5E+KxkxdTwniUE7pdiXgMPwslmNsZecTChU3huA8eBe0odFEqHu5/gGvfRhfVA2y/V6cFGcNKZWByTtIg==","signatures":[{"sig":"MEYCIQDr6Eqn7v/xipkNeaKqdX7b1w+RH5f3NBY2i3wfgT0P3wIhAOLqsSQOuI6RGYXN6PHvTFf9JyQCJy1h3W4rUkfwQnTd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15611},"main":"./src/index.js","type":"commonjs","_from":"file:diamir-nestjs-logger-11.0.1.tgz","types":"./src/index.d.ts","engines":{"node":">= 20"},"_npmUser":{"name":"ws-admin","email":"backend@webundsoehne.com"},"_resolved":"/tmp/2a0f74c562545ff5532239e28cc4f79a/diamir-nestjs-logger-11.0.1.tgz","_integrity":"sha512-UD5QZ5E+KxkxdTwniUE7pdiXgMPwslmNsZecTChU3huA8eBe0odFEqHu5/gGvfRhfVA2y/V6cFGcNKZWByTtIg==","repository":{"url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git","type":"git"},"_npmVersion":"10.9.8","description":"Nestjs logger based on winston","directories":{},"_nodeVersion":"22.22.3","dependencies":{"winston":"3.19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"nestjs-cls":">= 5.0.0","@nestjs/common":">= 11.0.0"},"peerDependenciesMeta":{"nestjs-cls":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/nestjs-logger_11.0.1_1778851685914_0.37647875849050894","host":"s3://npm-registry-packages-npm-production"}},"11.0.2":{"name":"@diamir/nestjs-logger","version":"11.0.2","keywords":["diamir","nestjs","logger","logging","winston"],"author":{"name":"Backend","email":"backend@diamir.io"},"license":"ISC","_id":"@diamir/nestjs-logger@11.0.2","maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"dist":{"shasum":"d81348d81886e4380ab7ca39b9d8b7ef31d12ce5","tarball":"https://registry.npmjs.org/@diamir/nestjs-logger/-/nestjs-logger-11.0.2.tgz","fileCount":21,"integrity":"sha512-XBK204WJWfllfDPSNjcsi9L7rse+gSMziZIx3UV7nVmDts1MajAtj+XA8fOdP/blMRdjVj7I1OGGenfqVEndRQ==","signatures":[{"sig":"MEUCIEzn38TSedpNgc29EC79zowZIzpmA6heGAJa1yPGI7i9AiEAoCy2lIzRhrAIByCroezrQ5ucsuPR9+nrUgZAsYGyK4s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15612},"main":"./src/index.js","type":"commonjs","_from":"file:diamir-nestjs-logger-11.0.2.tgz","types":"./src/index.d.ts","engines":{"node":">= 20"},"_npmUser":{"name":"ws-admin","email":"backend@webundsoehne.com"},"_resolved":"/tmp/b0d27c859918c2ea6bee89e5b47fa285/diamir-nestjs-logger-11.0.2.tgz","_integrity":"sha512-XBK204WJWfllfDPSNjcsi9L7rse+gSMziZIx3UV7nVmDts1MajAtj+XA8fOdP/blMRdjVj7I1OGGenfqVEndRQ==","repository":{"url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git","type":"git"},"_npmVersion":"10.9.8","description":"Nestjs logger based on winston","directories":{},"_nodeVersion":"22.22.3","dependencies":{"winston":"^3.19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"nestjs-cls":">= 5.0.0","@nestjs/common":">= 11.0.0"},"peerDependenciesMeta":{"nestjs-cls":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/nestjs-logger_11.0.2_1779200928574_0.09793434861998573","host":"s3://npm-registry-packages-npm-production"}},"11.0.3-beta.0":{"name":"@diamir/nestjs-logger","version":"11.0.3-beta.0","description":"Nestjs logger based on winston","author":{"name":"Backend","email":"backend@diamir.io"},"repository":{"type":"git","url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git"},"license":"ISC","publishConfig":{"access":"public"},"keywords":["diamir","nestjs","logger","logging","winston"],"main":"./src/index.js","dependencies":{"winston":"^3.19.0"},"peerDependencies":{"@nestjs/common":">= 11.0.0","nestjs-cls":">= 5.0.0"},"peerDependenciesMeta":{"nestjs-cls":{"optional":true}},"engines":{"node":">= 20"},"types":"./src/index.d.ts","type":"commonjs","_id":"@diamir/nestjs-logger@11.0.3-beta.0","bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","_integrity":"sha512-u4yVlZIj2PBlZoPZPtqdQohmwNM0JOpQ15V2w8wCZMfjVmoG38RWAp4BninixR9wFRlyTrKH2OyLxtsGZkaxYg==","_resolved":"/tmp/d20773378414a664feb79f4bbc39812e/diamir-nestjs-logger-11.0.3-beta.0.tgz","_from":"file:diamir-nestjs-logger-11.0.3-beta.0.tgz","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-u4yVlZIj2PBlZoPZPtqdQohmwNM0JOpQ15V2w8wCZMfjVmoG38RWAp4BninixR9wFRlyTrKH2OyLxtsGZkaxYg==","shasum":"b92badc58fc81aa4c8e0b4b0dea56b647f935a8f","tarball":"https://registry.npmjs.org/@diamir/nestjs-logger/-/nestjs-logger-11.0.3-beta.0.tgz","fileCount":21,"unpackedSize":15619,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDwOjrxfcy8SM20FtN8fVSGhIcN+Dg6WD5CXQcTGmmnhwIgV8aBcUhMDR2Sr855Zpz+5uUuQbv87X4Zp6EoyutwQ/o="}]},"_npmUser":{"name":"ws-admin","email":"backend@webundsoehne.com"},"directories":{},"maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-logger_11.0.3-beta.0_1784790092789_0.41588801757740756"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-12T13:32:31.697Z","modified":"2026-07-23T07:01:33.080Z","11.0.0":"2026-05-12T13:32:31.901Z","11.0.1":"2026-05-15T13:28:06.079Z","11.0.2":"2026-05-19T14:28:48.818Z","11.0.3-beta.0":"2026-07-23T07:01:32.915Z"},"bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"author":{"name":"Backend","email":"backend@diamir.io"},"license":"ISC","homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","keywords":["diamir","nestjs","logger","logging","winston"],"repository":{"type":"git","url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git"},"description":"Nestjs logger based on winston","maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"readme":"# nestjs-logger\n\n## Description\n\nCustom logger service based on [winston](https://github.com/winstonjs/winston.\n\nDetails from winston read-me:\n- Formats: [winston#formats](https://github.com/winstonjs/winston?tab=readme-ov-file#formats)\n- Transport: [winston#transports](https://github.com/winstonjs/winston?tab=readme-ov-file#transports)\n\n---\n\n<!-- TOC -->\n* [nestjs-logger](#nestjs-logger)\n  * [Description](#description)\n  * [Usage](#usage)\n  * [Options](#options)\n    * [Log-Level](#log-level)\n    * [Formats](#formats)\n    * [Transports](#transports)\n    * [ClsService](#clsservice)\n* [Migration](#migration)\n* [Links](#links)\n<!-- TOC -->\n\n---\n\n## Usage\n\nConstruct the `WinstonLogger` with an optional config during creation of the nest-application:\n\n```typescript\nimport { WinstonLogger } from '@diamir/nestjs-logger'\n\nconst app = await NestFactory.create(\n  ServerModule,\n  {\n    logger: new WinstonLogger()\n  }\n)\n```\n\nAfter initialisation use the nest `Logger` as usual, to get the customised output.\n\n## Options\n\nAvailable options and their default values.\n\n```typescript\nimport { LogLevel, PrettyFormat, transports, WinstonLogger } from '@diamir/nestjs-logger'\n\nnew WinstonLogger({\n  context: 'WinstonLogger', // override the default context\n  logLevel: LogLevel.debug, // set the output level\n  traceLogLevel: LogLevel.verbose, // set the output level for stack-trace\n  clsService: undefined, // (optional) link to the nestjs-cls service to log request ids\n  format: undefined, // (optional) default console transport output format\n  transports: [new transports.Console({ format: PrettyFormat })] // set custom winston transports\n})\n```\n\n### Log-Level\n\nFrom least to most log output.\n\n| **level** |\n|-----------|\n| none      |\n| error     |\n| warn      |\n| info      |\n| verbose   |\n| debug     |\n\nHint:<br>\n- `none` sets winston to `silent` and will not output any logs \n- `info` is equal to `log`/`Logger.log()`\n\n### Formats\n\nPredefined custom output formats<br>\nDefault output includes timestamp, context, message\n\n- **PrettyFormat**: `[2025-09-25T07:09:44.496Z] [info] [SampleService] - Example log-message`\n- **JsonFormat**: `{\"context\":\"SampleService\",\"level\":\"info\",\"message\":\"Example log-message\",\"splat\":[],\"timestamp\":\"2025-09-25T07:19:09.874Z\"}`\n\n**BaseFormat** used as base for the custom format.\n\ne.g.\n```typescript\nimport { BaseFormat, format } from '@diamir/nestjs-logger'\n\nconst CustomFormat = format.combine(\n  BaseFormat,\n  format.ms(),\n  format.simple()\n)\n```\n\n### Transports\n\nBy default, the `Console` transport is used with the `format` set in the `format` option or `PrettyFormat`.\n\nTo change the transports, pass a customised array in the options\n\n```typescript\nimport { JsonFormat, PrettyFormat, transports, WinstonLogger } from '@diamir/nestjs-logger'\n\n// extend the default logger with a seconds transport\nnew WinstonLogger({\n  transports: [ \n    new transports.Console({ format: PrettyFormat }),\n    new transports.File({ format: JsonFormat, file: 'server.logs' })\n  ]\n})\n\n// override the default logger with new transports\nnew WinstonLogger({\n  transports: [ \n    new transports.File({ format: JsonFormat, file: 'server.logs' }),\n    new transports.File({ format: JsonFormat, file: 'server_error.logs', level: 'error' })\n  ]\n})\n```\n\n### ClsService\n\nYou can use the [nestjs-cls](https://papooch.github.io/nestjs-cls/) package to include the current request-id in the logs, to see which log belongs to which request.\n\nFist add the `nestjs-cls` dependency, next set up the `ClsModule` in the server/application module and set the `generateId` option to `true`\n\ne.g.\n```typescript\nClsModule.forRoot({\n  global: true,\n  middleware: {\n    mount: true,\n    generateId: true\n  }\n})\n```\n\nFinally update the `WinstonLogger` options to set the `clsService` like\n\n```typescript\nimport { WinstonLogger } from '@diamir/nestjs-logger'\nimport { ClsServiceManager } from 'nestjs-cls'\n\nnew WinstonLogger({\n  clsService: ClsServiceManager.getClsService()\n})\n```\n\n# Migration\n\nTo migrate from the old `@webundsoehne/nestjs-util` to `@diamir/nestjs-logger`:\n- Change `LoggerService` class to `WinstonLogger`\n- manually link the `logLevel` in the class options (does not pull it via `ConfigService` any more)\n- update how the `clsService` is set (drop `setClsService`, move to class options)\n\n# Links\n- [Diamir](https://diamir.io/)\n- [nestjs](https://nestjs.com/)\n- [winston](https://github.com/winstonjs/winston)\n","readmeFilename":"README.md"}