{"id":22413371,"url":"https://github.com/rokid/aliyun-sls-stream","last_synced_at":"2025-03-27T03:27:51.296Z","repository":{"id":57176275,"uuid":"115579081","full_name":"rokid/aliyun-sls-stream","owner":"rokid","description":null,"archived":false,"fork":false,"pushed_at":"2017-12-29T09:03:47.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-09-27T09:35:26.990Z","etag":null,"topics":["aliyun","bunyan","log","sls","stream"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rokid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-28T03:04:22.000Z","updated_at":"2017-12-29T08:34:40.000Z","dependencies_parsed_at":"2022-09-03T23:32:05.644Z","dependency_job_id":null,"html_url":"https://github.com/rokid/aliyun-sls-stream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokid%2Faliyun-sls-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokid%2Faliyun-sls-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokid%2Faliyun-sls-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokid%2Faliyun-sls-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rokid","download_url":"https://codeload.github.com/rokid/aliyun-sls-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245776222,"owners_count":20670286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","bunyan","log","sls","stream"],"created_at":"2024-12-05T14:12:41.357Z","updated_at":"2025-03-27T03:27:51.278Z","avatar_url":"https://github.com/rokid.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 阿里云 SLS Stream\n\n阿里云 SLS PutLogs Stream\n\n## 使用方法\n\n1. 直接使用\n\n```js\nconst AliyunSlsStream = require('aliyun-sls-stream')\n\nconst stream = new AliyunSlsStream({\n  accessKeyId: 'your_very_secured_access_key_id',\n  secretAccessKey: 'your_very_secured_secret_access_key',\n  endpoint: 'an_aliyun_endpoint_for_sls', // refer to https://help.aliyun.com/document_detail/29008.html?spm=5176.doc28984.2.5.CMkSh1 for more details\n  project: process.env.ALIYUN_PROJECT,\n  logStore: process.env.ALIYUN_LOG_STORE\n})\n\nstream.write('Hello from the other side')\nstream.write({ foo: 'bar' })\n\n```\n\n2. 通过 `bunyan` 使用\n\n```js\nconst bunyan = require('bunyan')\nconst AliyunSlsStream = require('aliyun-sls-stream')\n\nconst log = bunyan.createLogger({\n  name: 'foo',\n  streams: [{\n    type: 'raw',\n    stream: new AliyunSlsStream({\n      accessKeyId: 'your_very_secured_access_key_id',\n      secretAccessKey: 'your_very_secured_secret_access_key',\n      endpoint: 'an_aliyun_endpoint_for_sls', // refer to https://help.aliyun.com/document_detail/29008.html?spm=5176.doc28984.2.5.CMkSh1 for more details\n      project: process.env.ALIYUN_PROJECT,\n      logStore: process.env.ALIYUN_LOG_STORE\n    }),\n    reemitErrorEvents: true\n  }],\n  level: 'debug'\n})\n\nlog.debug('foobar')\nlog.debug({ foo: 'bar' }, 'foobar')\nlog.debug({ foo: 'bar' }, 'foobar: %s', ['foo', 'bar'])\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frokid%2Faliyun-sls-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frokid%2Faliyun-sls-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frokid%2Faliyun-sls-stream/lists"}