{"id":29563658,"url":"https://github.com/jurrick/active_logger","last_synced_at":"2025-12-31T14:43:54.158Z","repository":{"id":52314294,"uuid":"257022551","full_name":"jurrick/active_logger","owner":"jurrick","description":"A rich logger extending the capabilities of the ActiveSupport logger","archived":false,"fork":false,"pushed_at":"2022-07-22T06:08:35.000Z","size":40,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T21:55:44.274Z","etag":null,"topics":["logger","ruby"],"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/jurrick.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":"2020-04-19T14:37:38.000Z","updated_at":"2020-06-07T06:58:09.000Z","dependencies_parsed_at":"2022-08-22T15:00:45.273Z","dependency_job_id":null,"html_url":"https://github.com/jurrick/active_logger","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/jurrick/active_logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurrick%2Factive_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurrick%2Factive_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurrick%2Factive_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurrick%2Factive_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jurrick","download_url":"https://codeload.github.com/jurrick/active_logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jurrick%2Factive_logger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265403314,"owners_count":23759294,"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":["logger","ruby"],"created_at":"2025-07-18T18:36:35.791Z","updated_at":"2025-12-31T14:43:54.132Z","avatar_url":"https://github.com/jurrick.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](http://img.shields.io/gem/v/active_logger.svg)](http://badge.fury.io/rb/active_logger) [![Build Status](https://travis-ci.com/jurrick/active_logger.svg?branch=master)](https://travis-ci.com/jurrick/active_logger)\n\n# ActiveLogger\n\nA rich logger extending the capabilities of the ActiveSupport logger\n\n## Features\n\n* Simple syntax for logging\n* Logging to multiple outputs (appenders)\n* Tagging\n* Global logger name\n* Custom formatter\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'active_logger'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install active_logger\n\n## Usage\n\n### Basic example\n\n```ruby\nlogger = ActiveLogger.new :stdout\nlogger.info 'test' # =\u003e test\n\n# with options\nlogger = ActiveLogger.new :stdout, level: :debug, formatter: :json, progname: :project1\n```\n\nThere are 3 types:\n\n* `:stdout` : Messages will be written to STDOUT\n* `:stderr` : Messages will be written to STDERR\n* `:file` : Messages will be written to a file\n\nAvailable standard options:\n\n* `level` - log level (`DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`)\n* `formatter` - format for logs: `:default`, `:json` or own custom formatter.\n* `progname` - program name.\n\n### File example\n\n```ruby\nlogger = ActiveLogger.new :file, filename: 'log/development.log', keep: 30, size: 10\nlogger.info 'test'\n```\n\nwhere:\n* filename - full path to logfile for writing\n* keep - count of files for keeping\n* size - maximum bytes for one file\n\n### Example: Block and multiple appenders\n\n```ruby\nlogger = ActiveLogger.new do |al|\n  al.appender :stdout\n  al.appender :file, filename: 'log/development.log', keep: 30, size: 10\nend\nlogger.info 'test'\n```\n\n### Example: Tagging\n\n```ruby\nlogger = ActiveLogger.new STDOUT\nlogger.tagged('API').info 'test'\n\n# or\n\nlogger.tagged('API') do\n  logger.info 'test'\nend\n```\n\n### Example: Global logger with name\n\n```ruby\nActiveLogger.new STDOUT, name: :logger1, level: :debug\nActiveLogger.new STDOUT, name: :logger2, level: :info\n\nlogger1 = ActiveLogger['logger1']\nlogger1.debug? # true\nlogger1.debug 'test'\n\nlogger2 = ActiveLogger['logger2']\nlogger2.debug? # false\nlogger2.info 'test2'\n```\n\n### Example: Custom formatter\n\nYou can create your own formatter:\n\n```ruby\nclass Formatter \u003c ActiveLogger::Formatters::Base\n  def call(severity, timestamp, progname, msg)\n    \"[#{severity}] [#{timestamp}] #{msg}\"\n  end\nend\n\nActiveLogger.new STDOUT, formatter: Formatter\n```\n\n### Example: Syslog\n\nYou can use syslog (support only UDP protocol):\n\n```ruby\nlogger = ActiveLogger.new :syslog, url: 'udp://sysloghost.com:514', facility: 'local3', maxsize: 1024\nlogger.info 'test' # =\u003e \u003c13\u003eMay  3 19:09:23 localhost console: test\n```\n\nAvailable options:\n\n* `url` - full url to syslog\n* `facility` - syslog facility (Example: 'user', 'local3', etc)\n* `maxsize` - maximum message size\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/jurrick/active_logger.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjurrick%2Factive_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjurrick%2Factive_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjurrick%2Factive_logger/lists"}