{"id":19481776,"url":"https://github.com/apex/logs-winston","last_synced_at":"2025-04-25T15:32:25.225Z","repository":{"id":146132442,"uuid":"279321402","full_name":"apex/logs-winston","owner":"apex","description":"Apex Logs integration for the Node.js Winston logging framework","archived":false,"fork":false,"pushed_at":"2020-08-31T09:45:29.000Z","size":14,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-21T07:26:08.859Z","etag":null,"topics":["apex-logs","logging","nodejs","winston-logger","winston-transport"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"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/apex.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-07-13T14:12:02.000Z","updated_at":"2023-10-16T23:47:16.000Z","dependencies_parsed_at":"2023-06-18T04:03:17.837Z","dependency_job_id":null,"html_url":"https://github.com/apex/logs-winston","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apex%2Flogs-winston","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apex%2Flogs-winston/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apex%2Flogs-winston/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apex%2Flogs-winston/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apex","download_url":"https://codeload.github.com/apex/logs-winston/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224007970,"owners_count":17240293,"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":["apex-logs","logging","nodejs","winston-logger","winston-transport"],"created_at":"2024-11-10T20:06:32.273Z","updated_at":"2024-11-10T20:06:33.285Z","avatar_url":"https://github.com/apex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n[Apex Logs](https://apex.sh/logs/) transport for the popular [Winston](https://github.com/winstonjs/winston) Node.js logging framework.\n\n## Installation\n\n```\nnpm install --save apex-logs-winston\n```\n\n## Usage\n\nLogs are buffered in memory and flushed periodically for more efficient ingestion. By default a `maxEntries` of 250, and `flushInterval` of 5 seconds (5000) are used.\n\n```js\nconst ApexLogsTransport = require('apex-logs-winston')\nconst winston = require('winston')\n\nconst apex = new ApexLogsTransport({\n  url: process.env.APEX_LOGS_URL,\n  authToken: process.env.APEX_LOGS_AUTH_TOKEN,\n  projectId: process.env.APEX_LOGS_PROJECT_ID,\n})\n\nconst logger = winston.createLogger({\n  levels: winston.config.syslog.levels,\n  transports: [apex],\n  defaultMeta: { program: 'api', host: 'api-01' }\n})\n\nlogger.info('User Login', { user: { name: 'Tobi Ferret' } })\n```\n\nHere's an example tuning the default buffering options:\n\n```js\nconst apex = new ApexLogsTransport({\n  url: process.env.APEX_LOGS_URL,\n  authToken: process.env.APEX_LOGS_AUTH_TOKEN,\n  projectId: process.env.APEX_LOGS_PROJECT_ID\n  buffer: { maxEntries: 100, flushInterval: 5000 }\n})\n```\n\n## Heroku \u0026 AWS Lambda\n\nServices such as Heroku and AWS Lambda expect logs to be written to stdout, in these cases use `json: true` to simple output an Apex Logs-friendly JSON format:\n\n```js\nconst apex = new ApexLogsTransport({ json: true })\n```\n\nNote that the other options do not apply in this situation.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapex%2Flogs-winston","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapex%2Flogs-winston","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapex%2Flogs-winston/lists"}