GitHub - reidmorrison/semantic_logger: Semantic Logger is a feature rich logging framework, and replacement for existing Ruby & Rails loggers. Skip to content Sign up Why GitHub? Features → Mobile → Actions → Codespaces → Packages → Security → Code review → Issues → Integrations → GitHub Sponsors → Customer stories→ Team Enterprise Explore Explore GitHub → Learn and contribute Topics → Collections → Trending → Learning Lab → Open source guides → Connect with others The ReadME Project → Events → Community forum → GitHub Education → GitHub Stars program → Marketplace Pricing Plans → Compare plans → Contact Sales → Education → In this repository All GitHub ↵ Jump to ↵ No suggested jump to results In this repository All GitHub ↵ Jump to ↵ In this user All GitHub ↵ Jump to ↵ In this repository All GitHub ↵ Jump to ↵ Sign in Sign up {{ message }} reidmorrison / semantic_logger Notifications Star 660 Fork 76 Semantic Logger is a feature rich logging framework, and replacement for existing Ruby & Rails loggers. logger.rocketjob.io/ Apache-2.0 License 660 stars 76 forks Star Notifications Code Issues 5 Pull requests 1 Actions Projects 0 Security Insights More Code Issues Pull requests Actions Projects Security Insights master Switch branches/tags Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 2 branches 61 tags Code Clone HTTPS GitHub CLI Use Git or checkout with SVN using the web URL. Work fast with our official CLI. Learn more. Open with GitHub Desktop Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit reidmorrison Validate IO object can write when supplied to an appender … 0b57c36 Jul 21, 2021 Validate IO object can write when supplied to an appender 0b57c36 Git stats 414 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github     docs     lib     test     .gitignore     .rubocop.yml     CHANGELOG.md     Gemfile     LICENSE.txt     README.md     Rakefile     semantic_logger.gemspec     View code Semantic Logger Documentation Upgrading to Semantic Logger v4.4 Logging Destinations Rails Rocket Job Optional Dependencies V4 Upgrade notes Install Author Versioning README.md Semantic Logger Semantic Logger is a feature rich logging framework, and replacement for existing Ruby & Rails loggers. https://logger.rocketjob.io/ Documentation Semantic Logger Guide Upgrading to Semantic Logger v4.4 With some forking frameworks it is necessary to call reopen after the fork. With v4.4 the workaround for Ruby 2.5 crashes is no longer needed. I.e. Please remove the following line if being called anywhere: SemanticLogger::Processor.instance.instance_variable_set(:@queue, Queue.new) Logging Destinations Logging to the following destinations are all supported "out-of-the-box": File Screen ElasticSearch. (Use with Kibana for Dashboards and Visualizations) Graylog BugSnag NewRelic Splunk MongoDB Honeybadger Sentry HTTP TCP UDP Syslog Add any existing Ruby logger as another destination. Roll-your-own Semantic Logger is capable of logging thousands of lines per second without slowing down the application. Traditional logging systems make the application wait while the log information is being saved. Semantic Logger avoids this slowdown by pushing log events to an in-memory queue that is serviced by a separate thread that only handles saving log information to multiple destinations / appenders. Rails When running Rails, use rails_semantic_logger instead of Semantic Logger directly since it will automatically replace the Rails default logger with Semantic Logger. Rocket Job Checkout the sister project Rocket Job: Ruby's missing batch system. Fully supports Semantic Logger when running jobs in the background. Complete support for job metrics sent via Semantic Logger to your favorite dashboards. Optional Dependencies The following gems are only required when their corresponding appenders are being used, and are therefore not automatically included by this gem: Bugsnag Appender: gem 'bugsnag' MongoDB Appender: gem 'mongo' 1.9.2 or above NewRelic Appender: gem 'newrelic_rpm' Syslog Appender: gem 'syslog_protocol' 0.9.2 or above Syslog Appender to a remote syslogng server over TCP or UDP: gem 'net_tcp_client' Splunk Appender: gem 'splunk-sdk-ruby' Elasticsearch Appender: gem 'elasticsearch' Kafka Appender: gem 'ruby-kafka' V4 Upgrade notes The following changes need to be made when upgrading to V4: Ruby V2.3 / JRuby V9.1 is now the minimum runtime version. Replace calls to Logger#with_payload with SemanticLogger.named_tagged. Replace calls to Logger#payload with SemanticLogger.named_tags. MongoDB Appender requires Mongo Ruby Client V2 or greater. Appenders now write payload data in a seperate :payload tag instead of mixing them directly into the root elements to avoid name clashes. As a result any calls like the following: logger.debug foo: 'foo', bar: 'bar' Must be replaced with the following in v4: logger.debug payload: {foo: 'foo', bar: 'bar'} Similarly, for measure blocks: logger.measure_info('How long is the sleep', foo: 'foo', bar: 'bar') { sleep 1 } Must be replaced with the following in v4: logger.measure_info('How long is the sleep', payload: {foo: 'foo', bar: 'bar'}) { sleep 1 } The common log call has not changed, and the payload is still logged directly: logger.debug('log this', foo: 'foo', bar: 'bar') Install gem install semantic_logger To configure a stand-alone application for Semantic Logger: require 'semantic_logger' # Set the global default log level SemanticLogger.default_level = :trace # Log to a file, and use the colorized formatter SemanticLogger.add_appender(file_name: 'development.log', formatter: :color) If running rails, see: Semantic Logger Rails Author Reid Morrison Contributors Versioning This project uses Semantic Versioning. About Semantic Logger is a feature rich logging framework, and replacement for existing Ruby & Rails loggers. logger.rocketjob.io/ Topics elasticsearch bugsnag splunk logging syslog rails-semantic-logger Resources Readme License Apache-2.0 License Releases 61 tags Packages 0 No packages published Contributors 45 + 34 contributors Languages Ruby 100.0% © 2021 GitHub, Inc. Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About You can’t perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.