https://github.com/TwP/logging
A flexible logging library for use in Ruby programs based on the design of Java's log4j library.
https://github.com/TwP/logging
Keywords
logging
Keywords from Contributors
rubygems rack rspec activerecord crash-reporting rakefile rake multithreading nokogiri activejob
Last synced: about 18 hours ago
JSON representation
Repository metadata
A flexible logging library for use in Ruby programs based on the design of Java's log4j library.
- Host: GitHub
- URL: https://github.com/TwP/logging
- Owner: TwP
- License: mit
- Created: 2008-05-30T04:03:30.000Z (almost 18 years ago)
- Default Branch: master
- Last Pushed: 2024-07-14T06:57:25.000Z (over 1 year ago)
- Last Synced: 2026-02-23T11:52:50.731Z (8 days ago)
- Topics: logging
- Language: Ruby
- Homepage: https://rubygems.org/gems/logging
- Size: 978 KB
- Stars: 531
- Watchers: 7
- Forks: 100
- Open Issues: 16
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.txt
- License: LICENSE
README.md
Logging
by Tim Pease
Description
Logging is a flexible logging library for use in Ruby programs based on the
design of Java's log4j library. It features a hierarchical logging system,
custom level names, multiple output destinations per log event, custom
formatting, and more.
Installation
gem install logging
Examples
This example configures a logger to output messages in a format similar to the
core ruby Logger class. Only log messages that are warnings or higher will be
logged.
require 'logging'
logger = Logging.logger(STDOUT)
logger.level = :warn
logger.debug "this debug message will not be output by the logger"
logger.warn "this is your last warning"
In this example, a single logger is created that will append to STDOUT and to a
file. Only log messages that are informational or higher will be logged.
require 'logging'
logger = Logging.logger['example_logger']
logger.level = :info
logger.add_appenders \
Logging.appenders.stdout,
Logging.appenders.file('example.log')
logger.debug "this debug message will not be output by the logger"
logger.info "just some friendly advice"
The Logging library was created to allow each class in a program to have its
own configurable logger. The logging level for a particular class can be
changed independently of all other loggers in the system. This example shows
the recommended way of accomplishing this.
require 'logging'
Logging.logger['FirstClass'].level = :warn
Logging.logger['SecondClass'].level = :debug
class FirstClass
def initialize
@logger = Logging.logger[self]
end
def some_method
@logger.debug "some method was called on #{self.inspect}"
end
end
class SecondClass
def initialize
@logger = Logging.logger[self]
end
def another_method
@logger.debug "another method was called on #{self.inspect}"
end
end
There are many more examples in the examples folder of the logging
package. The recommended reading order is the following:
- simple.rb
- rspec_integration.rb
- loggers.rb
- classes.rb
- hierarchies.rb
- names.rb
- lazy.rb
- appenders.rb
- layouts.rb
- reusing_layouts.rb
- formatting.rb
- colorization.rb
- fork.rb
- mdc.rb
Extending
The Logging framework is extensible via the little-plugger
gem-based plugin system. New appenders, layouts, or filters can be released as ruby
gems. When installed locally, the Logging framework will automatically detect
these gems as plugins and make them available for use.
The logging-email plugin is a good
example to follow. It includes a lib/logging/plugins/email.rb
file which is detected by the plugin framework. This file declares a
Logging::Plugins::Email.initialize_email method that is called when the plugin
is loaded.
The three steps for creating a plugin are:
- create a new Ruby gem:
logging-<name> - include a plugin file:
lib/logging/plugins/<name>.rb - define a plugin initializer:
Logging::Plugins::<Name>.initialize_<name>
Development
The Logging source code relies on the Mr Bones project for default rake tasks.
You will need to install the Mr Bones gem if you want to build or test the
logging gem. Conveniently there is a bootstrap script that you can run to setup
your development environment.
script/bootstrap
This will install the Mr Bones gem and the required Ruby gems for development.
After this is done you can rake rake -T to see the available rake tasks.
License
The MIT License - see the LICENSE file for the full text.
Owner metadata
- Name: Tim Pease
- Login: TwP
- Email:
- Kind: user
- Description:
- Website: http://pea53.com
- Location: Boulder, CO
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/6323?u=8fc9db5cc0c17c889a7dba25e7d9cfd242762c3f&v=4
- Repositories: 40
- Last ynced at: 2023-04-10T07:28:09.929Z
- Profile URL: https://github.com/TwP
GitHub Events
Total
- Pull request event: 1
- Issues event: 1
- Watch event: 4
- Issue comment event: 2
- Pull request review event: 1
Last Year
- Pull request event: 1
- Issues event: 1
- Watch event: 2
- Issue comment event: 1
- Pull request review event: 1
Committers metadata
Last synced: about 21 hours ago
Total Commits: 636
Total Committers: 42
Avg Commits per committer: 15.143
Development Distribution Score (DDS): 0.153
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Tim Pease | t****e@g****m | 539 |
| Olle Jonsson | o****n@g****m | 24 |
| kares | s****f@k****g | 6 |
| Noah Spitzer-Williams | n****h@s****m | 5 |
| Bernhard Brodowsky | b****b@e****h | 4 |
| mazimeng | m****m@c****m | 3 |
| Simon Chiang | s****g@p****m | 3 |
| Pavel Valodzka | p****l@v****e | 3 |
| Ben Klang | b****g@m****m | 3 |
| Peter Schrammel | p****l@g****e | 3 |
| Simon Chiang | s****g@g****m | 3 |
| Alex Bisceglie | a****x@c****m | 2 |
| Carlos Sanchez | c****z@m****m | 2 |
| David Barri | j****y@g****m | 2 |
| François Vantomme | a****m@g****m | 2 |
| Greg Brockman | g****b@g****m | 2 |
| Peter Mounce | p****e@n****m | 2 |
| Piotr Kuczynski | p****i@g****m | 2 |
| Robert Reiz | r****1@g****m | 2 |
| Jeremy Hinegardner | j****y@c****g | 2 |
| thmzlt | t****t | 1 |
| chocolateboy | c****e@c****g | 1 |
| beezTEM | b****4@g****m | 1 |
| William Johnston | w****m@j****s | 1 |
| Tim Meusel | t****m@b****e | 1 |
| Patrik Ragnarsson | p****k@s****t | 1 |
| Chris Tucker | c****r@s****m | 1 |
| Christo DeLange | c****e@a****m | 1 |
| Olle Jonsson | o****n@e****m | 1 |
| Tim Galeckas | t****s@c****l | 1 |
| and 12 more... | ||
Committer domains:
- langfeld.me: 1
- gabrielgilder.com: 1
- aura-online.co.uk: 1
- redhat.com: 1
- puppet.com: 1
- ecraft.com: 1
- amplify.com: 1
- service-now.com: 1
- starkast.net: 1
- bastelfreak.de: 1
- johnstonhaus.us: 1
- cpan.org: 1
- copiousfreetime.org: 1
- neverrunwithscissors.com: 1
- gregbrockman.com: 1
- maestrodev.com: 1
- cabulous.com: 1
- gmx.de: 1
- mojolingo.com: 1
- valodzka.name: 1
- pinnacol.com: 1
- chinayouthgroup.com: 1
- ethz.ch: 1
- spitzer-williams.com: 1
- kares.org: 1
Issue and Pull Request metadata
Last synced: 7 days ago
Total issues: 53
Total pull requests: 59
Average time to close issues: about 1 year
Average time to close pull requests: 8 months
Total issue authors: 43
Total pull request authors: 23
Average comments per issue: 1.34
Average comments per pull request: 1.07
Merged pull request: 42
Bot issues: 0
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 1.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- jessebs (4)
- TwP (3)
- MikaelSmith (2)
- lzap (2)
- attilastrba (2)
- cshupp1 (2)
- encryptedbot (2)
- ghostsquad (1)
- mhenrixon (1)
- dorner (1)
- tavlima (1)
- dwo (1)
- leonardteo (1)
- ufo2mstar (1)
- NicoLugil (1)
Top Pull Request Authors
- TwP (17)
- olleolleolle (12)
- bastelfreak (4)
- lzap (4)
- n-rodriguez (2)
- akihikodaki (2)
- ag4ta (2)
- will-in-wi (1)
- brodyhoskins (1)
- mazimeng (1)
- sean-heller (1)
- bhuga (1)
- thmzlt (1)
- reiz (1)
- ivoanjo (1)
Top Issue Labels
- Feature (2)
Top Pull Request Labels
Package metadata
- Total packages: 3
-
Total downloads:
- rubygems: 201,878,391 total
- Total docker downloads: 1,276,303,242
- Total dependent packages: 530 (may contain duplicates)
- Total dependent repositories: 10,381 (may contain duplicates)
- Total versions: 123
- Total maintainers: 1
gem.coop: logging
**Logging** is a flexible logging library for use in Ruby programs based on the design of Java's log4j library. It features a hierarchical logging system, custom level names, multiple output destinations per log event, custom formatting, and more.
- Homepage: http://rubygems.org/gems/logging
- Documentation: http://www.rubydoc.info/gems/logging/
- Licenses: MIT
- Latest release: 2.4.0 (published over 1 year ago)
- Last Synced: 2026-03-01T22:02:56.895Z (2 days ago)
- Versions: 60
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 100,938,753 Total
- Docker Downloads: 638,151,621
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.082%
- Downloads: 0.247%
- Maintainers (1)
rubygems.org: logging
**Logging** is a flexible logging library for use in Ruby programs based on the design of Java's log4j library. It features a hierarchical logging system, custom level names, multiple output destinations per log event, custom formatting, and more.
- Homepage: http://rubygems.org/gems/logging
- Documentation: http://www.rubydoc.info/gems/logging/
- Licenses: MIT
- Latest release: 2.4.0 (published over 1 year ago)
- Last Synced: 2026-03-01T23:32:51.327Z (1 day ago)
- Versions: 60
- Dependent Packages: 529
- Dependent Repositories: 10,381
- Downloads: 100,939,638 Total
- Docker Downloads: 638,151,621
-
Rankings:
- Dependent packages count: 0.085%
- Docker downloads count: 0.174%
- Downloads: 0.206%
- Dependent repos count: 0.328%
- Average: 0.978%
- Stargazers count: 2.469%
- Forks count: 2.603%
- Maintainers (1)
conda-forge.org: rb-logging
- Homepage: https://rubygems.org/gems/logging
- Licenses: MIT
- Latest release: 2.3.0 (published over 4 years ago)
- Last Synced: 2026-03-01T15:21:55.731Z (2 days ago)
- Versions: 3
- Dependent Packages: 1
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 15.683%
- Forks count: 16.062%
- Average: 23.647%
- Dependent packages count: 28.82%
- Dependent repos count: 34.025%
Dependencies
- actions/cache v3 composite
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
Score: 31.156205011389396