Semantic Logger is a high-performance, asynchronous structured logging framework for Ruby & Rails. Supports Syslog, Graylog, Elasticsearch, Splunk, Loggly, New Relic, Bugsnag, MongoDB, HTTP(S).
Developer toolsRubyGitHub @reidmorrisonOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Semantic Logger is a high-performance, asynchronous structured logging framework for Ruby and Rails.
Taken from the repository README
Loading the full README.
Read the full README ↗Semantic Logger is a high-performance, asynchronous structured logging framework for Ruby and Rails.
It differs from ordinary loggers in two important ways:
require "semantic_logger"
SemanticLogger.default_level = :info
SemanticLogger.add_appender(io: $stdout, formatter: :color)
logger = SemanticLogger["MyApp"]
# A plain message, plus structured data that stays searchable
logger.info("Queried users table", duration: 54, result: :ok, table: "users")
# Log an exception with its full backtrace, plus context
logger.error("Failed to process order", exception: exception, order_id: 42)
# Measure and log how long a block takes to run
logger.measure_info("Reindexing users") { reindex_users }
When running Rails, use rails_semantic_logger instead, since it replaces the Rails default logger with Semantic Logger automatically.
Start with the Introduction, then the Programmer's Guide.
docs/.Logging to the following destinations are all supported "out-of-the-box":
sentry-raven and modern sentry-ruby gem)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.
When running Rails, use rails_semantic_logger instead of Semantic Logger directly since it will automatically replace the Rails default logger with Semantic Logger.
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.
The following gems are only required when their corresponding appenders are being used, and are therefore not automatically included by this gem:
See the Upgrading Guide for instructions on upgrading between major versions.
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
Contributions are welcome. See CONTRIBUTING.md for how to set up the project, run the tests, and an overview of the architecture, including a class diagram.
This project uses Semantic Versioning.