{"id":18544486,"url":"https://github.com/instructure/paul_bunyan","last_synced_at":"2025-04-09T19:30:45.406Z","repository":{"id":56887587,"uuid":"41376310","full_name":"instructure/paul_bunyan","owner":"instructure","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-25T19:52:05.000Z","size":159,"stargazers_count":2,"open_issues_count":4,"forks_count":7,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-24T10:56:25.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/instructure.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,"governance":null}},"created_at":"2015-08-25T16:57:48.000Z","updated_at":"2023-03-06T17:44:26.000Z","dependencies_parsed_at":"2023-10-11T21:00:20.378Z","dependency_job_id":null,"html_url":"https://github.com/instructure/paul_bunyan","commit_stats":{"total_commits":74,"total_committers":15,"mean_commits":4.933333333333334,"dds":0.5135135135135135,"last_synced_commit":"ad25d4928e2f36fe0dea6474a5d9fa0897b8c7ad"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fpaul_bunyan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fpaul_bunyan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fpaul_bunyan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fpaul_bunyan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instructure","download_url":"https://codeload.github.com/instructure/paul_bunyan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247828822,"owners_count":21002975,"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":[],"created_at":"2024-11-06T20:16:41.463Z","updated_at":"2025-04-09T19:30:44.409Z","avatar_url":"https://github.com/instructure.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Paul Bunyan (formerly: Logging)\n\n[![Gem](https://badge.fury.io/rb/paul_bunyan.svg)](https://rubygems.org/gems/paul_bunyan)\n[![Build Status](https://secure.travis-ci.org/instructure/paul_bunyan.svg)](http://travis-ci.org/instructure/paul_bunyan)\n[![Dependency Status](https://gemnasium.com/badges/github.com/instructure/paul_bunyan.svg)](https://gemnasium.com/github.com/instructure/paul_bunyan)\n\nPaulBunyan is a re-usable component with a globally accessible Logger with extra\nsupport for handling logging in Rails.\n\n```\nclass Foo\n  include PaulBunyan\n\n  def bar\n    logger.warn \"blah\"\n  end\nend\n```\n\nAlso included is a Railtie that overrides the default rails logger to always\nprint to STDOUT as well as format the messages to JSON for machine readable\ngoodness. This has been tested with Rails 4.2 through 5.1, older versions of\nRails may work but are not guaranteed to and will not receive support.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'paul_bunyan'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install paul_bunyan\n\n## Usage\n\n### Non-Rails projects:\n\n```\nrequire 'paul_bunyan'\n\ninclude PaulBunyan\n\nlogger.warn \"blah\"\n```\n\n### Rails projects:\n\nNothing after it's added to your Gemfile, the Railtie takes care of the rest.\n\n### Adding metadata to JSON logs\nThe default logger includes the ability to accept arbitrary metadata, the\nprimary use case for this functionality is to add context to log lines generated\nin the course of processing a Rails request. There is an example for adding\nthe request host to the metadata in the examples directory. There are a few\nkeys that are used internally that will be overwritten when added to user\nsupplied metadata, this list can be found in the `#call` method of\n`PaulBunyan::JSONFormatter`.\n\n### Seeing what your server logs will look like in the console\nTo do this set `PB_DISABLE_CONSOLE_OVERRIDE` in your environment:\n`PB_DISABLE_CONSOLE_OVERRIDE=1 bundle exec rails c`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fpaul_bunyan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstructure%2Fpaul_bunyan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fpaul_bunyan/lists"}