Sha256: 97506af9fe466f8d73994441368b0499e4cf533e423633a3c47129810aae488e
Contents?: true
Size: 1.5 KB
Versions: 2
Compression:
Stored size: 1.5 KB
Contents
# Yologga Logger class patch for hourly log rotation support [![Build Status](https://travis-ci.org/umbrellio/yologga.svg?branch=master)](https://travis-ci.org/umbrellio/yologga) ## Requirements Ruby 2.3, 2.4 or 2.5 ## Installation - `gem install logga` and `require "yologga"` - 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 `Yologga.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 ### Setting autogzip on `Yologga.gzip = true` adds gzipping for rotated logs (disabled by default) ### Setting logs LogsLifetime `Yologga.logs_lifetime = 1.week ` or `Yologga.logs_lifetime = 604800` removes logs older than chosen period ## License Released under MIT License ## Authors Created by Dmitry Gubitskiy Evgeniy Lukovsky <a href="https://github.com/umbrellio/"> <img style="float: left;" src="https://umbrellio.github.io/Umbrellio/supported_by_umbrellio.svg" alt="Supported by Umbrellio" width="439" height="72"> </a>
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
yologga-0.3.3 | README.md |
yologga-0.3.2 | README.md |