{"id":19134017,"url":"https://github.com/umbrellio/log_sweeper","last_synced_at":"2025-05-06T19:22:47.685Z","repository":{"id":56882163,"uuid":"168924608","full_name":"umbrellio/log_sweeper","owner":"umbrellio","description":"A simple module for cleaning up log directories.","archived":false,"fork":false,"pushed_at":"2019-08-19T19:54:19.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-13T12:27:02.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/umbrellio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-03T08:26:09.000Z","updated_at":"2019-08-19T19:54:21.000Z","dependencies_parsed_at":"2022-08-20T13:00:47.500Z","dependency_job_id":null,"html_url":"https://github.com/umbrellio/log_sweeper","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Flog_sweeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Flog_sweeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Flog_sweeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Flog_sweeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umbrellio","download_url":"https://codeload.github.com/umbrellio/log_sweeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223793154,"owners_count":17203762,"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":[],"created_at":"2024-11-09T06:24:48.941Z","updated_at":"2024-11-09T06:24:49.536Z","avatar_url":"https://github.com/umbrellio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LogSweeper   [![Gem Version](https://badge.fury.io/rb/log_sweeper.svg)](https://badge.fury.io/rb/log_sweeper) [![Build Status](https://travis-ci.org/umbrellio/log_sweeper.svg?branch=master)](https://travis-ci.org/umbrellio/log_sweeper) [![Coverage Status](https://coveralls.io/repos/github/umbrellio/log_sweeper/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/log_sweeper?branch=master)\n\n`LogSweeper` is a simple module for cleaning up log directories.\n\nIt is designed to be used with Ruby logger rotation. By default, it will remove all log files older than 10 days and will gzip all log files that look like rotated log files. For example, `production.log.20190228` will be gzipped and replaced with `production.log.20190228.gz`. It logs what it's doing using the provided logger which defaults to `STDOUT` logger.\n\n## Installation\n\nSimply add `gem \"log_sweeper\"` to your Gemfile.\n\n## Examples\n\n```ruby\n  # Just use the defaults\n  LogSweeper.run(\"log\")\n\n  # Customize logs lifetime and logger\n  LogSweeper.run(\"log\", logs_lifetime_days_count: 5, logger: Logger.new(\"/path/to/file.log\"))\n\n  # In case you don't want any logging and deleting any logs\n  LogSweeper.run(\"log\", logs_lifetime_days_count: Float::INFINITY, logger: Logger.new(nil))\n```\n\nThe best way to use this module is to run it via cron, for example you can use [whenever](https://github.com/javan/whenever) gem with similar config in `schedule.rb` file:\n\n```ruby\nevery 1.hour do\n  runner \"LogSweeper.run('log')\"\nend\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/umbrellio/log_sweeper.\n\n## License\n\nReleased under MIT License.\n\n## Authors\n\nCreated by Yuri Smirnov.\n\n\u003ca href=\"https://github.com/umbrellio/\"\u003e\n\u003cimg style=\"float: left;\" src=\"https://umbrellio.github.io/Umbrellio/supported_by_umbrellio.svg\" alt=\"Supported by Umbrellio\" width=\"439\" height=\"72\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Flog_sweeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumbrellio%2Flog_sweeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Flog_sweeper/lists"}