{"id":41489201,"url":"https://github.com/eggjs/egg-logger-sls","last_synced_at":"2026-01-23T18:16:18.587Z","repository":{"id":57220568,"uuid":"146062320","full_name":"eggjs/egg-logger-sls","owner":"eggjs","description":"Logger transport for aliyun sls.","archived":false,"fork":false,"pushed_at":"2021-03-16T06:07:57.000Z","size":40,"stargazers_count":15,"open_issues_count":3,"forks_count":3,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-10-08T00:34:18.020Z","etag":null,"topics":["aliyun-log","aliyun-sls","egg-plugin","eggjs","logger","sls"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/eggjs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-25T03:43:22.000Z","updated_at":"2022-03-30T10:46:43.000Z","dependencies_parsed_at":"2022-08-28T23:23:16.103Z","dependency_job_id":null,"html_url":"https://github.com/eggjs/egg-logger-sls","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/eggjs/egg-logger-sls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger-sls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger-sls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger-sls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger-sls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggjs","download_url":"https://codeload.github.com/eggjs/egg-logger-sls/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs%2Fegg-logger-sls/sbom","scorecard":{"id":368743,"data":{"date":"2025-08-11","repo":{"name":"github.com/eggjs/egg-logger-sls","commit":"b351b652b4f23ce3b7c93e2190b12890b05a2d77"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/24 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-18T12:29:25.068Z","repository_id":57220568,"created_at":"2025-08-18T12:29:25.068Z","updated_at":"2025-08-18T12:29:25.068Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28697428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","response_time":59,"last_error":"SSL_read: 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":["aliyun-log","aliyun-sls","egg-plugin","eggjs","logger","sls"],"created_at":"2026-01-23T18:16:17.674Z","updated_at":"2026-01-23T18:16:18.580Z","avatar_url":"https://github.com/eggjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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 \u0026 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fegg-logger-sls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggjs%2Fegg-logger-sls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs%2Fegg-logger-sls/lists"}