Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app change link names Apr 9, 2019
bin implement rspec Oct 25, 2018
config add hourly logs controller and views Mar 12, 2019
lib add default file count for hourly logs Apr 9, 2019
spec refactor test specs, chance styles Mar 29, 2019
.gitignore fix test specs Feb 27, 2019
.rspec implement rspec Oct 25, 2018
.travis.yml Initialize the gem Oct 8, 2018
CODE_OF_CONDUCT.md Initialize the gem Oct 8, 2018
Gemfile implement rspec Oct 25, 2018
Gemfile.lock add default file count for hourly logs Apr 9, 2019
LICENSE.txt Initialize the gem Oct 8, 2018
MIT-LICENSE add engine Oct 24, 2018
README.md Fix typo in README Apr 15, 2019
Rakefile implement rspec Oct 25, 2018
highlight.gif
hour.gif add default file count for hourly logs Apr 9, 2019
log_file.gif update gifs Jan 15, 2019
rails-pretty-logger.gemspec

README.md

Rails::Pretty::Logger

Pretty Logger is a logging framework which can be checked from webpage, and also you can also debug easily with highlight method. You can also override logger class with Pretty logger so you can keep hourly logs, which can be limited as you wish.

Usage

visit http://your-webpage/rails-pretty-logger/dashboards/ then choose your environment, which you want to check and also you can set date range for narrowing down your logs.

How to use debug Highlighter

PrettyLogger.highlight("lorem ipsum")

Use Hourly Log Rotation

Add these lines below to environment config file which you want to override its logger, first argument for name of the log file, second argument for keeping hourly logs, file count for limiting the logs files.

Rails::Pretty::Logger::ConsoleLogger.new("rails-pretty-logger", "hourly", file_count: 48)

#/config/environments/development.rb

require "rails/pretty/logger/config/logger_config"

logger_file = ActiveSupport::TaggedLogging.new(Rails::Pretty::Logger::ConsoleLogger.new("rails-pretty-logger", "hourly", file_count: 48))
config.logger = logger_file

Installation

Add this line to your application's Gemfile:

gem 'rails-pretty-logger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rails-pretty-logger

Mount the engine in your config/routes.rb:

mount Rails::Pretty::Logger::Engine => "/rails-pretty-logger"

Contributing

  1. Fork the official repository.
  2. Create a topic branch.
  3. Implement your feature or bug fix.
  4. Add, commit, and push your changes.
  5. Submit a pull request.

License

The gem is available as open source under the terms of the MIT License.

You can’t perform that action at this time.