diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb5d8f0..8cb754a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,18 +15,23 @@ jobs: strategy: matrix: ruby: ['2.7', '3.0', '3.1', '3.2', '3.3'] - rails: ['5.2.7', '6.0.4', '6.1.7', '7.0.8', '7.1.1'] + rails: ['5.2.8', '6.0.6', '6.1.7', '7.0.8', '7.1.4', '7.2.1'] include: - - rails: '4.0.1' + - rails: '4.0.13' ruby: '2.7' - - rails: '4.1.1' + - rails: '4.1.16' ruby: '2.7' - - rails: '4.2.1' + - rails: '4.2.11' ruby: '2.7' - - rails: '5.0.1' + - rails: '5.0.7' ruby: '2.7' - - rails: '5.1.1' + - rails: '5.1.7' ruby: '2.7' + exclude: + - rails: '7.2.1' + ruby: '2.7' + - rails: '7.2.1' + ruby: '3.0' steps: - uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 31d58b0..e2cd02a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.6.4 +* Reorder the exception fields to have the `data` field before the `exception` field + # 2.6.3 * Fix Lorekeeper::BacktraceCleaner to support BacktraceLocation diff --git a/lib/lorekeeper/json_logger.rb b/lib/lorekeeper/json_logger.rb index 16c4636..00b9228 100644 --- a/lib/lorekeeper/json_logger.rb +++ b/lib/lorekeeper/json_logger.rb @@ -10,7 +10,7 @@ def initialize(file) reset_state @base_fields = { TIMESTAMP => '', MESSAGE => '', LEVEL => '' } - super(file) + super end def current_fields @@ -77,10 +77,11 @@ def exception(exception, custom_message = nil, custom_data = nil, custom_level = if exception.is_a?(Exception) backtrace = clean_backtrace(exception.backtrace || []) exception_fields = { + DATA => param_data, EXCEPTION => "#{exception.class}: #{exception.message}", STACK => backtrace } - exception_fields[DATA] = param_data if param_data + exception_fields.compact! message = param_message || exception.message with_extra_fields(exception_fields) { log_data(log_level, message) } diff --git a/lib/lorekeeper/version.rb b/lib/lorekeeper/version.rb index 0a2654b..d247b50 100644 --- a/lib/lorekeeper/version.rb +++ b/lib/lorekeeper/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lorekeeper - VERSION = '2.6.3' + VERSION = '2.6.4' end