{"id":28700726,"url":"https://github.com/tryghost/bunyan-rotating-file-stream","last_synced_at":"2025-10-08T03:43:39.920Z","repository":{"id":40313196,"uuid":"344091768","full_name":"TryGhost/bunyan-rotating-file-stream","owner":"TryGhost","description":"Rotate bunyan logs based on time period and file-size threshold","archived":false,"fork":false,"pushed_at":"2025-10-03T22:23:04.000Z","size":70,"stargazers_count":3,"open_issues_count":16,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-10-04T00:22:19.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/TryGhost.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"tryghost","open_collective":"ghost"}},"created_at":"2021-03-03T10:44:21.000Z","updated_at":"2025-04-04T03:42:39.000Z","dependencies_parsed_at":"2024-02-20T19:01:40.934Z","dependency_job_id":"cbe06575-fe84-42da-8446-a85f1ff3078d","html_url":"https://github.com/TryGhost/bunyan-rotating-file-stream","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":0.303030303030303,"last_synced_commit":"3754cbe3ae7d242c64dcc4e4d895866c6bb85b0a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/TryGhost/bunyan-rotating-file-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fbunyan-rotating-file-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fbunyan-rotating-file-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fbunyan-rotating-file-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fbunyan-rotating-file-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TryGhost","download_url":"https://codeload.github.com/TryGhost/bunyan-rotating-file-stream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fbunyan-rotating-file-stream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278886409,"owners_count":26062975,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-06-14T11:30:39.337Z","updated_at":"2025-10-08T03:43:39.915Z","avatar_url":"https://github.com/TryGhost.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tryghost","https://opencollective.com/ghost"],"categories":[],"sub_categories":[],"readme":"# Bunyan Rotating Filestream\n\n## Install\n\n`npm install @tryghost/bunyan-rotating-filestream --save`\n\nor\n\n`yarn add @tryghost/bunyan-rotating-filestream`\n\n\n## Usage\n\nCreate a bunyan logger using the stream:\n\n```js\n    var log = bunyan.createLogger({\n        name: 'foo',\n        streams: [{\n            stream: new RotatingFileStream({\n                path: '/var/log/foo.log',\n                period: '1d',          // daily rotation\n                totalFiles: 10,        // keep up to 10 backup copies\n                rotateExisting: true,  // Give ourselves a clean file when we start up, based on period\n                threshold: '10m',      // Rotate log files larger than 10 megabytes\n                totalSize: '20m',      // Don't keep more than 20mb of archived log files\n                gzip: true             // Compress the archive log files to save space\n            })\n        }]\n    });\n```\n\nOther options include `startNewFile` to always open a new file on start-up.\n\n## Develop\n\n1. `git clone` this repo \u0026 `cd` into it as usual\n2. Run `yarn` to install top-level dependencies.\n\n## Test\n\n- `yarn lint` run just eslint\n- `yarn test` run lint and tests\n\n\n## Publish\n\n- `yarn ship`\n\n## Credit\n\nMany thanks to @Rcomian for their work on the original bunyan-rotating-file-stream project, this project borrows lots of the code and all of the ideas in the original.\n\n# Copyright \u0026 License \n\nCopyright (c) 2013-2025 Ghost Foundation - Released under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryghost%2Fbunyan-rotating-file-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftryghost%2Fbunyan-rotating-file-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryghost%2Fbunyan-rotating-file-stream/lists"}