Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/umbrellio/hourly_logger_rotator
Ruby Logger patch for hourly log rotation
https://github.com/umbrellio/hourly_logger_rotator
log-rotation log-rotator logger rotator ruby-logger
Last synced: about 1 month ago
JSON representation
Ruby Logger patch for hourly log rotation
- Host: GitHub
- URL: https://github.com/umbrellio/hourly_logger_rotator
- Owner: umbrellio
- License: mit
- Created: 2018-03-05T13:54:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-24T11:13:57.000Z (almost 5 years ago)
- Last Synced: 2024-10-30T03:37:38.830Z (about 2 months ago)
- Topics: log-rotation, log-rotator, logger, rotator, ruby-logger
- Language: Ruby
- Size: 35.2 KB
- Stars: 7
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# HourlyLoggerRotator · [![Gem Version](https://badge.fury.io/rb/hourly_logger_rotator.svg)](https://badge.fury.io/rb/hourly_logger_rotator) [![Build Status](https://travis-ci.org/umbrellio/hourly_logger_rotator.svg?branch=master)](https://travis-ci.org/umbrellio/hourly_logger_rotator) [![Coverage Status](https://coveralls.io/repos/github/umbrellio/hourly_logger_rotator/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/hourly_logger_rotator?branch=master)
Logger class patch for hourly log rotation support
## Requirements
Ruby 2.3, 2.4, 2.5, 2.6 or 2.7
## Installation
- `gem install hourly_logger_rotator` and `require "hourly_logger_rotation"`
- Or add it to your Gemfile and `bundle`## Usage
Requiring the gem automatically adds an `hourly` rotation period support to Ruby's standard
Logger class. You can initialize it like this:```
Logger.new('some_log_file', 'hourly')
```Keep in mind that loggers created before the gem is required will not
support the hourly rotation period. Specifically, in case of a Rails app,
require this before Rails initializes; a good place to do that is in `application.rb`
right after requiring `boot`### Setting default rotation period
`HourlyLoggerRotator.default_rotation_period=(some_period)` will make it so newly created
loggers have a rotation period of `some_period` unless you provide an explicit
period in the constructor## License
Released under MIT License## Authors
Created by Dmitry Gubitskiy