{"_id":"@catalystclan/egg-logger-sls","_rev":"4-9271b0f30f86e2ae14ef09c90b375ac9","name":"@catalystclan/egg-logger-sls","dist-tags":{"latest":"1.4.2-5"},"versions":{"1.4.2-1":{"name":"@catalystclan/egg-logger-sls","version":"1.4.2-1","description":"Logger transport for aliyun sls","eggPlugin":{"name":"loggerSLS","dependencies":["sls"]},"keywords":["egg","eggPlugin","egg-plugin"],"dependencies":{"address":"^1.0.3","aggregate-base":"^1.2.0","egg-logger":"^3.0.0","sdk-base":"^3.6.0"},"devDependencies":{"autod":"^3.0.1","autod-egg":"^1.1.0","egg":"^2.11.0","egg-bin":"^4.8.5","egg-mock":"^3.20.1","egg-sls":"^1.0.0-alpha.1","eslint":"^5.6.0","eslint-config-egg":"^7.1.0","mz-modules":"^2.1.0"},"engines":{"node":">=8.6.0"},"scripts":{"test":"npm run lint && egg-bin pkgfiles && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"egg-bin pkgfiles --check && npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles","autod":"autod"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-logger-sls.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-logger-sls#readme","author":{"name":"popomore"},"license":"MIT","gitHead":"4958df1e93d1bc794965dad69a4073c2eb2e2c4d","_id":"@catalystclan/egg-logger-sls@1.4.2-1","_nodeVersion":"18.15.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-9dTMagC9kkpDMhMJ/Hhb2iMy11pMMlxj4NmM40nywzXRsWrdl2Q6LLzQeG/v4acletNHM9u8Li8v5L17ZDMOhg==","shasum":"b0ba8191bd7a405e803ca4fb4cc7b472805d7584","tarball":"https://registry.npmjs.org/@catalystclan/egg-logger-sls/-/egg-logger-sls-1.4.2-1.tgz","fileCount":7,"unpackedSize":12806,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSvpnobhtrWurVUIjcH9TNWsqTdK1byGKogof1GCq21AIhAPxr//fFW/FUAMNU3K/uH0EZCMSq7A3wBRLOJ3EmpTLQ"}]},"_npmUser":{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"},"directories":{},"maintainers":[{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-logger-sls_1.4.2-1_1700574279626_0.6103204775442035"},"_hasShrinkwrap":false},"1.4.2-2":{"name":"@catalystclan/egg-logger-sls","version":"1.4.2-2","description":"Logger transport for aliyun sls","eggPlugin":{"name":"loggerSLS","dependencies":["sls"]},"keywords":["egg","eggPlugin","egg-plugin"],"dependencies":{"address":"^1.0.3","aggregate-base":"^1.2.0","egg-logger":"^3.0.0","sdk-base":"^3.6.0"},"devDependencies":{"autod":"^3.0.1","autod-egg":"^1.1.0","egg":"^2.11.0","egg-bin":"^4.8.5","egg-mock":"^3.20.1","egg-sls":"^1.0.0-alpha.1","eslint":"^5.6.0","eslint-config-egg":"^7.1.0","mz-modules":"^2.1.0"},"engines":{"node":">=8.6.0"},"scripts":{"test":"npm run lint && egg-bin pkgfiles && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"egg-bin pkgfiles --check && npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles","autod":"autod"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-logger-sls.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-logger-sls#readme","author":{"name":"popomore"},"license":"MIT","gitHead":"00bb1c2f420abd1aaf6b4722827d2bc3ccfdb80a","_id":"@catalystclan/egg-logger-sls@1.4.2-2","_nodeVersion":"18.15.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-3sybImdo0nUwPihotZ680wcoj5qY8bPQwEV1zW7Kdu4PK7h8RfeElvaS4Y6fOlXnTTzeJKXczi2gogfdNHuPyA==","shasum":"fcf88f8ac855b2fe13e77faae087b59fc2229dd5","tarball":"https://registry.npmjs.org/@catalystclan/egg-logger-sls/-/egg-logger-sls-1.4.2-2.tgz","fileCount":7,"unpackedSize":12814,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFaJRiio9l86is3GQJ35PUkQWp49ehPVDyqj69woNvYJAiEA/zCDHrxhJtPkVC6wIZU1rCfQgmWwF7FBDIgBRzeeZQc="}]},"_npmUser":{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"},"directories":{},"maintainers":[{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-logger-sls_1.4.2-2_1700574516891_0.00566194447533741"},"_hasShrinkwrap":false},"1.4.2-3":{"name":"@catalystclan/egg-logger-sls","version":"1.4.2-3","description":"Logger transport for aliyun sls","eggPlugin":{"name":"loggerSLS","dependencies":["sls"]},"keywords":["egg","eggPlugin","egg-plugin"],"dependencies":{"address":"^1.0.3","aggregate-base":"^1.2.0","egg-logger":"^3.0.0","sdk-base":"^3.6.0"},"devDependencies":{"autod":"^3.0.1","autod-egg":"^1.1.0","egg":"^2.11.0","egg-bin":"^4.8.5","egg-mock":"^3.20.1","egg-sls":"^1.0.0-alpha.1","eslint":"^5.6.0","eslint-config-egg":"^7.1.0","mz-modules":"^2.1.0"},"engines":{"node":">=8.6.0"},"scripts":{"test":"npm run lint && egg-bin pkgfiles && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"egg-bin pkgfiles --check && npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles","autod":"autod"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-logger-sls.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-logger-sls#readme","author":{"name":"popomore"},"license":"MIT","gitHead":"5a155759521400989994079d96532ce51eed1346","_id":"@catalystclan/egg-logger-sls@1.4.2-3","_nodeVersion":"18.15.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-pPEYPTxeAB2Gtdpa7OnmjrDamCOsLPwQBkxWq64QKIlkG4GTUhpubg8ahX8nMGxgvKbGH3XLXax6RUlyW1FStQ==","shasum":"df0ba0c5d1f52639baa164cadc6de882898b98f9","tarball":"https://registry.npmjs.org/@catalystclan/egg-logger-sls/-/egg-logger-sls-1.4.2-3.tgz","fileCount":7,"unpackedSize":12799,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG2AaiJIiSGqXGSyXMnvmx5vaJys+apP4jMUgmiT2y+0AiEAv3q3GPdAeM8O3mz0CRrezLyDu0VjBH74HEtbvaNTfGw="}]},"_npmUser":{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"},"directories":{},"maintainers":[{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-logger-sls_1.4.2-3_1700574589131_0.94447484446196"},"_hasShrinkwrap":false},"1.4.2-4":{"name":"@catalystclan/egg-logger-sls","version":"1.4.2-4","description":"Logger transport for aliyun sls","eggPlugin":{"name":"loggerSLS","dependencies":["sls"]},"keywords":["egg","eggPlugin","egg-plugin"],"dependencies":{"address":"^1.0.3","aggregate-base":"^1.2.0","egg-logger":"^3.0.0","sdk-base":"^3.6.0"},"devDependencies":{"autod":"^3.0.1","autod-egg":"^1.1.0","egg":"^2.11.0","egg-bin":"^4.8.5","egg-mock":"^3.20.1","egg-sls":"^1.0.0-alpha.1","eslint":"^5.6.0","eslint-config-egg":"^7.1.0","mz-modules":"^2.1.0"},"engines":{"node":">=8.6.0"},"scripts":{"test":"npm run lint && egg-bin pkgfiles && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"egg-bin pkgfiles --check && npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles","autod":"autod"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-logger-sls.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-logger-sls#readme","author":{"name":"popomore"},"license":"MIT","gitHead":"b6646df1c5249de9d98ed2a6383acb1b721c2185","_id":"@catalystclan/egg-logger-sls@1.4.2-4","_nodeVersion":"18.15.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-J/F+Kx1mLlhKyY94AgmCOugZPFzdw1nD4stHRLk/DV5w2CXg302rFyiSrKjcO3UiO8OnJgzwHyCGUyped6QkvA==","shasum":"47f6883421c890ff76b737ff0fdd1e6751027f6d","tarball":"https://registry.npmjs.org/@catalystclan/egg-logger-sls/-/egg-logger-sls-1.4.2-4.tgz","fileCount":7,"unpackedSize":12828,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJ5aTApNfsgF4wIcJ10LNhxld/l1onzu2aL6PKP8f3aAiEA7mAM9hknhHhxYdnqyDZy/qS6NRtVImr+Q69Q8FgFmL4="}]},"_npmUser":{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"},"directories":{},"maintainers":[{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-logger-sls_1.4.2-4_1700574783599_0.689342827036449"},"_hasShrinkwrap":false},"1.4.2-5":{"name":"@catalystclan/egg-logger-sls","version":"1.4.2-5","description":"Logger transport for aliyun sls","eggPlugin":{"name":"loggerSLS","dependencies":["sls"]},"keywords":["egg","eggPlugin","egg-plugin"],"dependencies":{"address":"^1.0.3","aggregate-base":"^1.2.0","egg-logger":"^3.0.0","sdk-base":"^3.6.0"},"devDependencies":{"autod":"^3.0.1","autod-egg":"^1.1.0","egg":"^3.17.5","egg-bin":"^5.14.2","egg-mock":"^5.10.9","egg-sls":"^1.0.0-alpha.1","eslint":"^5.6.0","eslint-config-egg":"^7.1.0","mz-modules":"^2.1.0"},"engines":{"node":">=8.6.0"},"scripts":{"test":"npm run lint && egg-bin pkgfiles && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"egg-bin pkgfiles --check && npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles","autod":"autod"},"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-logger-sls.git"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"homepage":"https://github.com/eggjs/egg-logger-sls#readme","author":{"name":"popomore"},"license":"MIT","gitHead":"cba6e5b97ecd61b696ab12414ad7449106f651e8","_id":"@catalystclan/egg-logger-sls@1.4.2-5","_nodeVersion":"18.15.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-HSssIPsYk+yr3Tkn+N64+59iT6ZKB/WSqjU5w6oBun+sOi/i9+d6KuFF2VeiAtVUn2/qWh4GyN1xI8iourxqQw==","shasum":"4d45e06b500646d45478cd5e2d0548636fe394e5","tarball":"https://registry.npmjs.org/@catalystclan/egg-logger-sls/-/egg-logger-sls-1.4.2-5.tgz","fileCount":7,"unpackedSize":12872,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEutbUm0Hjc2FJQ1Zxd4G9gsN/Ucb8SKOQG1ZD+kB7zQIgQBQj1FK+yKnXpBrQFcTPelBaEfIZV85zKc3U/wqGogE="}]},"_npmUser":{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"},"directories":{},"maintainers":[{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-logger-sls_1.4.2-5_1700575234680_0.40681386156356236"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-21T13:44:39.538Z","1.4.2-1":"2023-11-21T13:44:39.905Z","modified":"2023-11-21T14:00:35.116Z","1.4.2-2":"2023-11-21T13:48:37.072Z","1.4.2-3":"2023-11-21T13:49:49.364Z","1.4.2-4":"2023-11-21T13:53:03.846Z","1.4.2-5":"2023-11-21T14:00:34.887Z"},"maintainers":[{"name":"jakelaoyu","email":"jake.laoyu@gmail.com"}],"description":"Logger transport for aliyun sls","homepage":"https://github.com/eggjs/egg-logger-sls#readme","keywords":["egg","eggPlugin","egg-plugin"],"repository":{"type":"git","url":"git+https://github.com/eggjs/egg-logger-sls.git"},"author":{"name":"popomore"},"bugs":{"url":"https://github.com/eggjs/egg/issues"},"license":"MIT","readme":"# egg-logger-sls\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-logger-sls.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-logger-sls\n[travis-image]: https://img.shields.io/travis/eggjs/egg-logger-sls.svg?style=flat-square\n[travis-url]: https://travis-ci.org/eggjs/egg-logger-sls\n[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-logger-sls.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/eggjs/egg-logger-sls?branch=master\n[david-image]: https://img.shields.io/david/eggjs/egg-logger-sls.svg?style=flat-square\n[david-url]: https://david-dm.org/eggjs/egg-logger-sls\n[snyk-image]: https://snyk.io/test/npm/egg-logger-sls/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-logger-sls\n[download-image]: https://img.shields.io/npm/dm/egg-logger-sls.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-logger-sls\n\nLogger transport for aliyun sls.\n\n## Install\n\n```bash\n$ npm i egg-sls --save\n$ npm i egg-logger-sls --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.sls = {\n  enable: true,\n  package: 'egg-sls',\n};\nexports.loggerSLS = {\n  enable: true,\n  package: 'egg-logger-sls',\n};\n```\n\n## Configuration\n\nYou should configure [egg-sls] first.\n\n```js\n// {app_root}/config/config.default.js\nexports.loggerSLS = {\n  // sls client name\n  client: null,\n  // sls project name\n  project: '',\n  // sls logstore name\n  logstore: '',\n  // the list of logger name that can be disabled\n  disable: [],\n  // the function that can modify and filter the logs\n  transform: null,\n};\n```\n\nIf client is not specified, it will use `app.sls` as default client, otherwise it will get the sls client with the specified name in multiple client case.\n\n```js\n// {app_root}/config/config.default.js\nexports.sls = {\n  clients: {\n    sls: {\n      endpoint: process.env.SLS_ENDPOINT,\n      accessKeyId: process.env.SLS_ACCESS_KEY_ID,\n      accessKeySecret: process.env.SLS_ACCESS_KEY_SECRET,\n    },\n  },\n};\nexports.loggerSLS = {\n  client: 'sls',\n  project: '',\n  logstore: '',\n};\n```\n\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n## Usage\n\nThe only thing you should do is configuration, this module will upload log automatically.\n\n### Disable Logger\n\nYou and disable logger with `disable` config.\n\n```js\nexports.customLogger = {\n  myLogger: {\n    file: '/path/to/log',\n  },\n};\nexports.loggerSLS = {\n  disable: [\n    // won't upload this logger\n    'myLogger',\n  ],\n}\n```\n\n### Transform and Filter\n\nYou can transform the log data before upload.\n\n```js\nexports.loggerSLS = {\n  transform(log, args) {\n    return log;\n  },\n}\n```\n\nIf you want to ignore some log, you can return false when transform.\n\n```js\nexports.loggerSLS = {\n  transform(log) {\n    if (some condition) return false;\n    return log;\n  },\n}\n```\n\nThere is two arguments that transform have.\n\n1. One is log object, it contains the default property, which is `ip`, `hostname`, `env`, `appName`, `loggerName`, `loggerFileName`, `level`. The last one is `content` that is the log string formated from the arguments when you call log method.\n1. The other is original arguments when you call log method, it will not format to content.\n\n### Data Structure\n\nThe data structure uploaded in below, you can create index in aliyun console as your wish.\n\n- level: logger level\n- content: the infomation that you logged\n- ip: the host ip\n- hostname: the host name\n- env: the egg environment\n- appName: the package name\n- loggerName: the logger name defined by Egg\n- loggerFileName: the logger file path\n\n### Logger Level\n\nThe default logger in Egg contains two level: level and consoleLevel, If you want set level for sls, you can use `slsLevel`.\n\n```js\n// config/config.default.js\nmodule.exports = {\n  logger: {\n    // for all logs\n    slsLevel: 'DEBUG',\n  },\n\n  customLogger: {\n    // only for one log\n    testLogger: {\n      slsLevel: 'ERROR',\n    },\n  },\n};\n```\n\nIf `slsLevel` is not specified, it will use level instead.\n\n\n## Questions & Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](LICENSE)\n\n[egg-sls]: https://github.com/eggjs/egg-sls\n","readmeFilename":"README.md"}