{"id":13394907,"url":"https://github.com/reidmorrison/semantic_logger","last_synced_at":"2025-05-13T00:07:26.046Z","repository":{"id":4225152,"uuid":"5347450","full_name":"reidmorrison/semantic_logger","owner":"reidmorrison","description":"Semantic Logger is a feature rich logging framework, and replacement for existing Ruby \u0026 Rails loggers.","archived":false,"fork":false,"pushed_at":"2024-12-20T18:14:18.000Z","size":2472,"stargazers_count":885,"open_issues_count":24,"forks_count":128,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-05-01T02:41:07.068Z","etag":null,"topics":["bugsnag","elasticsearch","logging","rails-semantic-logger","splunk","syslog"],"latest_commit_sha":null,"homepage":"https://logger.rocketjob.io/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reidmorrison.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"reidmorrison"}},"created_at":"2012-08-08T20:52:40.000Z","updated_at":"2025-04-23T15:28:52.000Z","dependencies_parsed_at":"2023-02-10T06:45:25.509Z","dependency_job_id":"cce1e261-e826-4353-b985-6c9107c3aead","html_url":"https://github.com/reidmorrison/semantic_logger","commit_stats":{"total_commits":415,"total_committers":71,"mean_commits":5.845070422535211,"dds":"0.26987951807228916","last_synced_commit":"055b7272091d78374b00e4fc3382bc2bb0443f12"},"previous_names":["rocketjob/semantic_logger"],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reidmorrison%2Fsemantic_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reidmorrison%2Fsemantic_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reidmorrison%2Fsemantic_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reidmorrison%2Fsemantic_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reidmorrison","download_url":"https://codeload.github.com/reidmorrison/semantic_logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253141474,"owners_count":21860541,"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":["bugsnag","elasticsearch","logging","rails-semantic-logger","splunk","syslog"],"created_at":"2024-07-30T17:01:35.803Z","updated_at":"2025-05-13T00:07:26.022Z","avatar_url":"https://github.com/reidmorrison.png","language":"Ruby","readme":"# Semantic Logger\n[![Gem Version](https://img.shields.io/gem/v/semantic_logger.svg)](https://rubygems.org/gems/semantic_logger) [![Build Status](https://github.com/reidmorrison/semantic_logger/workflows/build/badge.svg)](https://github.com/reidmorrison/semantic_logger/actions?query=workflow%3Abuild) [![Downloads](https://img.shields.io/gem/dt/semantic_logger.svg)](https://rubygems.org/gems/semantic_logger) [![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](http://opensource.org/licenses/Apache-2.0) ![](https://img.shields.io/badge/status-Production%20Ready-blue.svg)\n\nSemantic Logger is a feature rich logging framework, and replacement for existing Ruby \u0026 Rails loggers.\n\n* https://logger.rocketjob.io/\n\n## Documentation\n\n[Semantic Logger Guide](https://logger.rocketjob.io/)\n\n## Logging Destinations\n\nLogging to the following destinations are all supported \"out-of-the-box\":\n\n* File\n* Screen\n* ElasticSearch. (Use with Kibana for Dashboards and Visualizations)\n* Graylog\n* BugSnag\n* NewRelic\n* Splunk\n* MongoDB\n* Honeybadger (exceptions and events)\n* Sentry (both with legacy `sentry-raven` and modern `sentry-ruby` gem)\n* HTTP\n* TCP\n* UDP\n* Syslog\n* Add any existing Ruby logger as another destination.\n* Roll-your-own\n\nSemantic Logger is capable of logging thousands of lines per second without slowing\ndown the application. Traditional logging systems make the application wait while\nthe log information is being saved. Semantic Logger avoids this slowdown by pushing\nlog events to an in-memory queue that is serviced by a separate thread that only\nhandles saving log information to multiple destinations / appenders.\n\n## Rails\n\nWhen running Rails, use [rails_semantic_logger](http://github.com/reidmorrison/rails_semantic_logger)\ninstead of Semantic Logger directly since it will automatically replace the Rails default logger with Semantic Logger.\n\n## Rocket Job\n\nCheckout the sister project [Rocket Job](http://rocketjob.io): Ruby's missing batch system.\n\nFully supports Semantic Logger when running jobs in the background. Complete support for job metrics\nsent via Semantic Logger to your favorite dashboards.\n\n## Optional Dependencies\n\nThe following gems are only required when their corresponding appenders are being used,\nand are therefore not automatically included by this gem:\n- Bugsnag Appender: gem 'bugsnag'\n- MongoDB Appender: gem 'mongo' 1.9.2 or above\n- Honeybadger Appender: gem 'honeybadger'\n- HoneybadgerInsights Appender: gem 'honeybadger'\n- NewRelic Appender: gem 'newrelic_rpm'\n- NewRelicLogs Appender: gem 'newrelic_rpm'\n- Syslog Appender: gem 'syslog_protocol' 0.9.2 or above\n- Syslog Appender to a remote syslogng server over TCP or UDP: gem 'net_tcp_client'\n- Splunk Appender: gem 'splunk-sdk-ruby'\n- Elasticsearch Appender: gem 'elasticsearch'\n- Kafka Appender: gem 'ruby-kafka'\n- Legacy Sentry Appender: gem 'sentry-raven' (deprecated)\n- Sentry Appender: gem 'sentry-ruby'\n\n## Upgrading to Semantic Logger v4.9\n\nThese changes should not be noticeable by the majority of users of Semantic Logger, since\nthey are to the internal API. It is possible that advanced users may be using these internal\nAPI's directly.\n\nThis does not affect any calls to the public api `SemanticLogger.add_appender`.\n\nFile and IO are now separate appenders. When creating the File appender explicitly, its arguments\nhave changed. For example, when requesting an IO stream, it needs to be changed from:\n\n~~~ruby\nSemanticLogger::Appender::File.new(io: $stderr)\n~~~\nto:\n~~~ruby\nSemanticLogger::Appender::IO.new($stderr)\n~~~\n\nAdditionally, this needs to be changed from:\n~~~ruby\nSemanticLogger::Appender::File.new(file_name: \"file.log\")\n~~~\nto:\n~~~ruby\nSemanticLogger::Appender::File.new(\"file.log\")\n~~~\n\nRails Semantic Logger, if used, needs to be upgraded to v4.9 when upgrading to Semantic Logger v4.9.\n\n## Upgrading to Semantic Logger v4.4\n\nWith some forking frameworks it is necessary to call `reopen` after the fork. With v4.4 the\nworkaround for Ruby 2.5 crashes is no longer needed.\nI.e. Please remove the following line if being called anywhere:\n\n~~~ruby\nSemanticLogger::Processor.instance.instance_variable_set(:@queue, Queue.new)\n~~~\n\n## Upgrading to Semantic Logger v4.0\n\nThe following changes need to be made when upgrading to V4:\n- Ruby V2.3 / JRuby V9.1 is now the minimum runtime version.\n- Replace calls to Logger#with_payload with SemanticLogger.named_tagged.\n- Replace calls to Logger#payload with SemanticLogger.named_tags.\n- MongoDB Appender requires Mongo Ruby Client V2 or greater.\n- Appenders now write payload data in a seperate :payload tag instead of mixing them\n  directly into the root elements to avoid name clashes.\n\nAs a result any calls like the following:\n\n~~~ruby\nlogger.debug foo: 'foo', bar: 'bar'\n~~~\n\nMust be replaced with the following in v4:\n\n~~~ruby\nlogger.debug payload: {foo: 'foo', bar: 'bar'}\n~~~\n\nSimilarly, for measure blocks:\n\n~~~ruby\nlogger.measure_info('How long is the sleep', foo: 'foo', bar: 'bar') { sleep 1 }\n~~~\n\nMust be replaced with the following in v4:\n\n~~~ruby\nlogger.measure_info('How long is the sleep', payload: {foo: 'foo', bar: 'bar'}) { sleep 1 }\n~~~\n\nThe common log call has not changed, and the payload is still logged directly:\n\n~~~ruby\nlogger.debug('log this', foo: 'foo', bar: 'bar')\n~~~\n\n## Install\n\n    gem install semantic_logger\n\nTo configure a stand-alone application for Semantic Logger:\n\n~~~ruby\nrequire 'semantic_logger'\n\n# Set the global default log level\nSemanticLogger.default_level = :trace\n\n# Log to a file, and use the colorized formatter\nSemanticLogger.add_appender(file_name: 'development.log', formatter: :color)\n~~~\n\nIf running rails, see: [Semantic Logger Rails](https://logger.rocketjob.io/rails.html)\n\n## Author\n\n[Reid Morrison](https://github.com/reidmorrison)\n\n[Contributors](https://github.com/reidmorrison/semantic_logger/graphs/contributors)\n\n## Versioning\n\nThis project uses [Semantic Versioning](http://semver.org/).\n","funding_links":["https://github.com/sponsors/reidmorrison"],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freidmorrison%2Fsemantic_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freidmorrison%2Fsemantic_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freidmorrison%2Fsemantic_logger/lists"}