{"_id":"@awasthishiva/nestjs-log","_rev":"2-2b34d89e23e3a3cf4d388e4765eb3a47","name":"@awasthishiva/nestjs-log","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@awasthishiva/nestjs-log","version":"1.0.0","keywords":["nestjs"],"author":{"name":"Avnish","email":"awasthishiva@gmail.com"},"license":"MIT","_id":"@awasthishiva/nestjs-log@1.0.0","maintainers":[{"name":"awasthishiva","email":"awasthishiva@gmail.com"}],"homepage":"https://github.com/awasthishiva/nestjs-log#readme","bugs":{"url":"https://github.com/awasthishiva/nestjs-log"},"dist":{"shasum":"e42d4ded57087ae4591f0f74834ba72171094d37","tarball":"https://registry.npmjs.org/@awasthishiva/nestjs-log/-/nestjs-log-1.0.0.tgz","fileCount":29,"integrity":"sha512-ONNLZ1et9RSgETKPw5Zqp5J/SmrwzfW5tOIh3Tsn0NqZgRM/tjTiOrb6M8vZVNTOzs2AR5kMAmeAuyz6esFbzg==","signatures":[{"sig":"MEQCIFLn2JbAAYnA5Y13Po61goGiShu/lO1ya7C1pO4H819vAiAKETdxI0RumEW8snaLc+kfpJSG4FvVk0uD2TEWZk43wQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27686},"jest":{"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","coverageDirectory":"../coverage","moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","gitHead":"320f3ff5ea675ac5867dad93176f086f4b44f6b3","scripts":{"lint":"tslint -p tsconfig.json -c tslint.json","test":"jest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run build","test:cov":"jest --coverage","test:e2e":"jest --config ./test/jest-e2e.json","start:dev":"tsc -w","test:watch":"jest --watch"},"_npmUser":{"name":"awasthishiva","email":"awasthishiva@gmail.com"},"repository":{"url":"git+https://github.com/awasthishiva/nestjs-log.git","type":"git"},"_npmVersion":"6.14.4","description":"NestJS logger","directories":{},"_nodeVersion":"12.18.0","dependencies":{"@types/ws":"^8.5.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","rxjs":"^6.5.4","eslint":"^6.8.0","rimraf":"^3.0.2","ts-jest":"25.2.1","ts-node":"^8.6.2","prettier":"^1.19.1","supertest":"^4.0.2","ts-loader":"^6.2.1","typescript":"^3.7.4","@nestjs/cli":"^7.0.0","@types/jest":"25.1.4","@types/node":"^13.9.1","@nestjs/core":"^7.0.0","@nestjs/common":"^7.0.0","@types/express":"^4.17.3","tsconfig-paths":"^3.9.0","@nestjs/testing":"^7.0.0","@types/supertest":"^2.0.8","reflect-metadata":"^0.1.13","@nestjs/schematics":"^7.0.0","eslint-plugin-import":"^2.20.1","@elastic/elasticsearch":"^7.10.0","eslint-config-prettier":"^6.10.0","@nestjs/platform-express":"^7.0.0","@typescript-eslint/parser":"^2.23.0","@typescript-eslint/eslint-plugin":"^2.23.0"},"peerDependencies":{"@nestjs/common":"^7.0.0","@elastic/elasticsearch":"^7.10.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-log_1.0.0_1736868118119_0.6266705065625513","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@awasthishiva/nestjs-log","version":"1.0.1","keywords":["nestjs"],"author":{"name":"Avnish","email":"awasthishiva@gmail.com"},"license":"MIT","_id":"@awasthishiva/nestjs-log@1.0.1","maintainers":[{"name":"awasthishiva","email":"awasthishiva@gmail.com"}],"homepage":"https://github.com/awasthishiva/nestjs-log#readme","bugs":{"url":"https://github.com/awasthishiva/nestjs-log"},"dist":{"shasum":"24d2985160da396f87f96f2ea89944ad7b943647","tarball":"https://registry.npmjs.org/@awasthishiva/nestjs-log/-/nestjs-log-1.0.1.tgz","fileCount":29,"integrity":"sha512-cf7KytjQwU9odSV9V7SIveFWIn2UtB3gTFyq3MTAoj8OEuCULMDY+rsR93bOYzt0KNJXAEGl1ffGt+XXA6Z/XQ==","signatures":[{"sig":"MEQCIEcONReSliYLm6YpDsX+OWqcJBZ5pgWVJKDu+0qVHrKzAiBmsO1+QVfyq8bzY9GIX1obXtTvFTSDoj4b3UWEQUHV4w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28088},"jest":{"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","coverageDirectory":"../coverage","moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","gitHead":"9039fc63992771ea89ed8a72cc790e2bbd211f08","scripts":{"lint":"tslint -p tsconfig.json -c tslint.json","test":"jest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run build","test:cov":"jest --coverage","test:e2e":"jest --config ./test/jest-e2e.json","start:dev":"tsc -w","test:watch":"jest --watch"},"_npmUser":{"name":"awasthishiva","email":"awasthishiva@gmail.com"},"repository":{"url":"git+https://github.com/awasthishiva/nestjs-log.git","type":"git"},"_npmVersion":"6.14.4","description":"NestJS logger","directories":{},"_nodeVersion":"12.18.0","dependencies":{"@types/ws":"^8.5.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.1.0","rxjs":"^6.5.4","eslint":"^6.8.0","rimraf":"^3.0.2","ts-jest":"25.2.1","ts-node":"^8.6.2","prettier":"^1.19.1","supertest":"^4.0.2","ts-loader":"^6.2.1","typescript":"^3.7.4","@nestjs/cli":"^7.0.0","@types/jest":"25.1.4","@types/node":"^13.9.1","@nestjs/core":"^7.0.0","@nestjs/common":"^7.0.0","@types/express":"^4.17.3","tsconfig-paths":"^3.9.0","@nestjs/testing":"^7.0.0","@types/supertest":"^2.0.8","reflect-metadata":"^0.1.13","@nestjs/schematics":"^7.0.0","eslint-plugin-import":"^2.20.1","@elastic/elasticsearch":"^7.10.0","eslint-config-prettier":"^6.10.0","@nestjs/platform-express":"^7.0.0","@typescript-eslint/parser":"^2.23.0","@typescript-eslint/eslint-plugin":"^2.23.0"},"peerDependencies":{"@nestjs/common":"^7.0.0","@elastic/elasticsearch":"^7.10.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-log_1.0.1_1736869701578_0.9486618628764905","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@awasthishiva/nestjs-log","version":"1.0.2","description":"NestJS logger","author":{"name":"Avnish","email":"awasthishiva@gmail.com"},"license":"MIT","main":"dist/index.js","scripts":{"start:dev":"tsc -w","build":"tsc","prepare":"npm run build","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json -c tslint.json","test":"jest","test:watch":"jest --watch","test:cov":"jest --coverage","test:e2e":"jest --config ./test/jest-e2e.json"},"keywords":["nestjs"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/awasthishiva/nestjs-log.git"},"bugs":{"url":"https://github.com/awasthishiva/nestjs-log"},"peerDependencies":{"@elastic/elasticsearch":"^7.10.0","@nestjs/common":"^7.0.0"},"devDependencies":{"@elastic/elasticsearch":"^7.10.0","@nestjs/cli":"^7.0.0","@nestjs/common":"^7.0.0","@nestjs/core":"^7.0.0","@nestjs/platform-express":"^7.0.0","@nestjs/schematics":"^7.0.0","@nestjs/testing":"^7.0.0","@types/express":"^4.17.3","@types/jest":"25.1.4","@types/node":"^13.9.1","@types/supertest":"^2.0.8","@typescript-eslint/eslint-plugin":"^2.23.0","@typescript-eslint/parser":"^2.23.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-plugin-import":"^2.20.1","jest":"^25.1.0","prettier":"^1.19.1","reflect-metadata":"^0.1.13","rimraf":"^3.0.2","rxjs":"^6.5.4","supertest":"^4.0.2","ts-jest":"25.2.1","ts-loader":"^6.2.1","ts-node":"^8.6.2","tsconfig-paths":"^3.9.0","typescript":"^3.7.4"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":"src","testRegex":".spec.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"coverageDirectory":"../coverage","testEnvironment":"node"},"dependencies":{"@types/ws":"^8.5.4"},"gitHead":"50d4d815d449a3e661592358df239194404b520c","homepage":"https://github.com/awasthishiva/nestjs-log#readme","_id":"@awasthishiva/nestjs-log@1.0.2","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uUg173KJl/d4xK0LHJEqllJWn/Sjc0VSFl83dOZUlQ5bc37bMglFhVHM1m1RVhnvCiQda+HTON56gp3AP+4grg==","shasum":"94432e2c6efe7627ab5213f2b2701c0999c7753f","tarball":"https://registry.npmjs.org/@awasthishiva/nestjs-log/-/nestjs-log-1.0.2.tgz","fileCount":29,"unpackedSize":27962,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEsqugud93eGL2jdYy536UnBqh6/+L7bpkTff8zMfcJUAiAc8gYbg4EC5LAuFKCV7XiVW6bLSQ9fXmMa1EZn5wJZEA=="}]},"_npmUser":{"name":"awasthishiva","email":"awasthishiva@gmail.com"},"directories":{},"maintainers":[{"name":"awasthishiva","email":"awasthishiva@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-log_1.0.2_1736913886325_0.5117767744264643"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-14T15:21:58.051Z","modified":"2025-01-15T04:04:46.725Z","1.0.0":"2025-01-14T15:21:58.289Z","1.0.1":"2025-01-14T15:48:21.758Z","1.0.2":"2025-01-15T04:04:46.521Z"},"bugs":{"url":"https://github.com/awasthishiva/nestjs-log"},"author":{"name":"Avnish","email":"awasthishiva@gmail.com"},"license":"MIT","homepage":"https://github.com/awasthishiva/nestjs-log#readme","keywords":["nestjs"],"repository":{"type":"git","url":"git+https://github.com/awasthishiva/nestjs-log.git"},"description":"NestJS logger","maintainers":[{"name":"awasthishiva","email":"awasthishiva@gmail.com"}],"readme":"<h1 align=\"center\"></h1>\n\n<div align=\"center\">\n  <a href=\"http://nestjs.com/\" target=\"_blank\">\n    <img src=\"https://nestjs.com/img/logo_text.svg\" width=\"150\" alt=\"Nest Logo\" />\n  </a>\n</div>\n\n<h3 align=\"center\">NestJS npm Package Starter</h3>\n\n<div align=\"center\">\n  <a href=\"https://nestjs.com\" target=\"_blank\">\n    <img src=\"https://img.shields.io/badge/built%20with-NestJs-red.svg\" alt=\"Built with NestJS\">\n  </a>\n</div>\n\n### Installation\n\n```bash\nnpm install @syukurilexs/nestjs-log\n```\n\n## Usage\nImport `LoggerModule`:\n\n```typescript\nimports: [LoggerModule.register()]\n```\nThis module is Global type, just import in module.app.js and can use it anywhere\n\n## Usage to write log to Elasticsearch and Console\nTo use Elasticsearch for logging you need to install Elasticsearch package\n\n```bash\nnpm install @elastic/elasticsearch\n```\n\nImport `LoggerModule`:\n\n```typescript\nimports: [\n  LoggerModule.register({\n    elasticsearch: { node: 'http://localhost:9200', prefix: 'syukur' },\n  }),\n],\n```\n\n### Options\n- node: elastic search url\n- prefix: index name (when use it with LoggerService it will append prefix ***log***), \nand also today date, daily bucket)\n\n## Usage for Async method to write log to Elasticsearch and Console\nTo use Elasticsearch for logging you need to install Elasticsearch package\n\n```bash\nnpm install @elastic/elasticsearch\n```\n\nImport `LoggerModule`:\n\n```typescript\nimports: [\n  LoggerModule.registerAsync({\n    imports: [ConfigModule],\n    useFactory: (config: ConfigService) => {\n      return {\n        elasticsearch: { node: config.get('URL'), prefix: 'syukur' },\n      };\n    },\n    inject: [ConfigService],\n  }),\n],\n```\n## Available Services \n### LoggerService\n```typescript\nconstructor(private readonly logger: LoggerService) {}\n\nmyMethod() {\n  this.logger.log('This is message');\n  this.logger.warn('This is warning');\n  this.logger.error('This is error','This is tracing' | {key: value});\n}\n```\n### ReportService\n```typescript\nconstructor(private readonly report: ReportService) {}\n\nmyMethod() {\n  this.report.send({key: value, key2: value2});\n}\n\n```\n\n## Change Log\n\nSee [Changelog](CHANGELOG.md) for more information.\n\n## Contributing\n\nContributions welcome! See [Contributing](CONTRIBUTING.md).\n\n## Author\n\n**Syukur [LinkedIn](https://www.linkedin.com/in/syukurilexs/)**\n\n## License\n\nLicensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","readmeFilename":"README.md"}