- Features & enhancements
- Do not log exceptions which are handled by Rails. Therefore you can't get false alarms from your exception notifier
- Fix
- fixing a Rails 6.1 specific issue with ActiveRecord array parameter in a query (
User.where(id: [1,2,3,4])
)
- fixing a Rails 6.1 specific issue with ActiveRecord array parameter in a query (
- Fix
- fixing an issue with the Sidekiq job's log context generation:
using a namespaced Sidekiq worker (
SomeModule::SomeWorker
) cause the log context generations to fail with:NameError: wrong constant name SomeModule::SomeWorker
- fixing an issue with the Sidekiq job's log context generation:
using a namespaced Sidekiq worker (
- Features & enhancements
- added Ruby 2.7 to the list of version CI will test the code with
- remove dot-files and Rakefile from the gem
- Fix
- stop using
Hash#merge
with multiple arguments as it's only supported from Ruby 2.6
- stop using
- Features & enhancements
-
Switching to Oj for fast JSON serialization
-
Allow level to be formatted (so it can be logged as a number too)
if you want to use Ougai-like numbers you can do something like this:
config.ezlog.layout_options = { level_formatter: ->(level_number) { (level_number + 2) * 10 } } Rails.logger.error('Boom!') #=> {"logger":"Application","timestamp":"2020-09-20T19:29:03+02:00","level":50,"hostname":"BUD010256.local","pid":19872,"message":"Boom!"}
-
initial context (a context which will be added to every single line of log) can be configured via
config.ezlog.layout_options
and it defaults to{environment: ::Rails.env}
-
- Features & enhancements
- Improvements of the Sidekiq integration
- supports additional job information: batch id, tags and thread id (bid, tags, tid)
- support logging "death" events (setting up a death_handler)
- Improvements of the Sidekiq integration
- Bug fixed
- Fixed a bug in access log exclusion pattern matching that would exclude partial matches for a path if it was specified as a string (expecting to be excluded only in case of a full match).
- Features & enhancements
- Ezlog now supports Rails 6.
- Added the ability to exclude certain paths from access logging. Use the
exclude_paths
configuration option to add paths (strings or regexps) to exclude from your access logs.
- Bug fixes
- Reverted the change introduced in
v0.5.2
which extended the Sidekiq logger interface because it caused problems with other third-party integrations (e.g. sidekiq-unique-jobs). Sidekiq itself removed this interface element inv6.0.1
, so the current change breaks compatibility with Sidekiqv6.0.0
exclusively. If you're using that version, please upgrade.
- Reverted the change introduced in
- Bug fixes
- Fixed a bug in the Sidekiq error handler which caused the error handler to throw an additional error if there was no job hash in the original error context.
- Features & enhancements
- Added the ability to configure parameter logging of the Rails access log.
By default, all parameters are logged under the key
params
. By turning on thelog_only_whitelisted_params
config swith, you can make sure that only the parameters whose name is included in thewhitelisted_params
config setting get logged under theparams
key. All parameters will still be logged, but serialized into a single string under theparams_seralized
key, not creating a lot of noise underparams
.
- Added the ability to configure parameter logging of the Rails access log.
By default, all parameters are logged under the key
- Features & enhancements
- Disabled Sequel logging by default. It can be enabled with the
enable_sequel_logging
config switch.
- Disabled Sequel logging by default. It can be enabled with the
- Features & enhancements
- Added support for the new "job-specific log level" feature in Sidekiq 6.0.1
- Bug fixes
- Sidekiq logger now supports the Sidekiq 6
logger interface which includes the method
with_context
. This is important because other gems (notably sidekiq-unique-jobs) depend on this method and might break if it's not present.
- Sidekiq logger now supports the Sidekiq 6
logger interface which includes the method
- Bug fixes
- Projects that don't use ActiveRecord can still use Ezlog. The previous version tried to replace ActiveRecord's log subscriber even when ActiveRecord wasn't used and thus halted the initialization process.
- Features & enhancements
- Support Sidekiq 6 logging
- Log the underlying (real) job class when using Sidekiq wrapped into Active Job
-
Features & enhancements
- Added log context management methods
within_log_context
andadd_to_log_context
to Ezlog module. - Replaced ActiveRecord query logging with a log subscriber that logs queries via Ezlog.
- Added automatic query logging (at DEBUG level) to Sequel connections.
- Added log context management methods
-
Bug fixes
- ActionDispatch::DebugExceptions is no longer replaced because other gems (like web-console) are depending on it.
- Bug fixes
- Requiring
ezlog/rspec
in thespec_helper
correctly captures log messages produced during tests. Requiringezlog
(as was done in the previous version) fails to capture logs because it loads the gem beforeRails
is defined so the Railtie doesn't get executed.
- Requiring
- Bug fixes
- Ezlog is required when requiring
ezlog/rspec
. This way all dependencies are in place even ifBundler.require
wasn't called. - Access log now correctly logs requests that fail with an uncaught error. Previously these requests were logged
with a path of
/500
.
- Ezlog is required when requiring
- Features & enhancements
- Sidekiq logging respects the log level configured for the application.
- Log level can be set from an environment variable (LOG_LEVEL).
-
Features & enhancements
- Ruby 2.4 is supported
-
Bug fixes
- Default log level is now set for the root logger instead of the root log layout so that the log level can be overriden programatically per logger (if necessary)
-
Features & enhancements
- Unified access log for Rails
- 1 message per request
- Includes request ID, parameters, response code
- Non-verbose logging of uncaught exceptions in Rails apps
- 1 message per error
- Use ERROR level instead of FATAL
- Rack::Timeout logging is now completely turned off, because Timeout errors are handled by the application's error logger and we don't want duplicated log messages
- Unified access log for Rails
-
Bug fixes
- Fix bug where the application log level wasn't set to INFO by default but remained on DEBUG
- Features & enhancements
- Sidekiq error handler now logs the same job context as the JobLogger
-
Features & enhancements
-
Bug fixes
- Fix bug where exceptions without a backtrace would not get logged
First version of the gem including the following:
- Features & enhancements
- Use Logging library for all logging
- Includes logging layout for JSON logging to STDOUT
- JobLogger for Sidekiq
- Filter Rack::Timeout logs to WARN level and above
- RSpec support
- Rails integration via Railtie
- Use Logging library for all logging