{"id":17979120,"url":"https://github.com/thelicato/pino-rotating-file-stream","last_synced_at":"2025-03-25T17:31:58.676Z","repository":{"id":166352920,"uuid":"641810926","full_name":"thelicato/pino-rotating-file-stream","owner":"thelicato","description":"A transport for pino that rotates logs","archived":false,"fork":false,"pushed_at":"2023-05-17T10:16:11.000Z","size":32,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-20T06:12:53.807Z","etag":null,"topics":["log-rotation","logging","pino","pino-transport"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pino-rotating-file-stream","language":"TypeScript","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/thelicato.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}},"created_at":"2023-05-17T08:05:49.000Z","updated_at":"2025-03-14T01:40:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"783f4b1d-55e8-4455-9bd8-c72c0863c4e5","html_url":"https://github.com/thelicato/pino-rotating-file-stream","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thelicato%2Fpino-rotating-file-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thelicato%2Fpino-rotating-file-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thelicato%2Fpino-rotating-file-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thelicato%2Fpino-rotating-file-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thelicato","download_url":"https://codeload.github.com/thelicato/pino-rotating-file-stream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245510789,"owners_count":20627262,"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":["log-rotation","logging","pino","pino-transport"],"created_at":"2024-10-29T17:36:29.241Z","updated_at":"2025-03-25T17:31:58.670Z","avatar_url":"https://github.com/thelicato.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pino-rotating-file-stream\n\n[![NPM Package Version](https://img.shields.io/npm/v/pino-rotating-file-stream)](https://www.npmjs.com/package/pino-rotating-file-stream)\n\n## Description\n\nThis module provides a **transport** for *pino* to automatically rotates logs. Under the hood, it uses [rotating-file-stream](https://www.npmjs.com/package/rotating-file-stream) even though some fields have been added to the default *Options*.\n\n## CLI\nThe current version of this packages has only support for the module usage as described in the [Programmatic Integration](#programmatic-integration) section. This feature will be added in next versions of the package.\nFor now you can rely on [@vrbo/pino-rotating-file](https://www.npmjs.com/package/@vrbo/pino-rotating-file) for CLI integration.\n## Programmatic Integration\nInstall ``pino-rotating-file-stream`` alongside ``pino`` and set the transport to ``pino-rotating-file-stream``:\n\n```js\nconst pino = require('pino')\nconst logger = pino({\n  transport: {\n    target: 'pino-rotating-file-stream',\n    options: {\n      filename: 'app.log', // Required\n      path: './logs', // Required\n    },\n  },\n})\n\nlogger.info('hi')\n```\n\nSee also the example in the ``examples`` folder.\n\n### Options\nThe options are essentially the same provided by ``rotating-file-stream`` except form two new entries. The following list shows all the options with the default values:\n```js\n{\n  filename: string; // Specifies the name of the file. Required.\n  path: string // Specifies the base path for files. Required.\n  size: string // Specifies the file size to rotate the file. Default: '100M'.\n  maxSize: string // Specifies the maximum size of rotated files to keep. Default: '1G'.\n  interval: string // Specifies the time interval to rotate the file. Default: '7d'.\n  compress: boolean | string | Function // Specifies compression method of rotated files. Default: 'gzip'.\n  encoding: string // Specifies the default encoding. Default: 'utf8'.\n  history: string // Specifies the history filename. Default: null.\n  immutable: boolean // Never mutate file names. Default: null.\n  initialRotation: boolean // Initial rotation based on not-rotated file timestamp. Default: null.\n  intervalBoundary: boolean // Makes rotated file name with lower boundary of rotation period. Default: null.\n  maxFiles: number // Specifies the maximum number of rotated files to keep. Default: null.\n  mode: number // Proxied to fs.createWriteStream. Default: 0o666.\n  omitExtension: // boolean Omits the .gz extension from compressed rotated files. Default: null.\n  rotate: number // Enables the classical UNIX logrotate behaviour. Default: null.\n  teeToStdout: boolean // Writes file content to stdout as well. Default: null.\n}\n```\n\n## License\n\n[MIT](./LICENSE) License © 2023 [Angelo Delicato](https://github.com/thelicato)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthelicato%2Fpino-rotating-file-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthelicato%2Fpino-rotating-file-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthelicato%2Fpino-rotating-file-stream/lists"}