From 562c8627085b97658f31696a07b71a879ef669db Mon Sep 17 00:00:00 2001 From: Iris Lau Date: Thu, 15 Jun 2023 10:49:04 +0100 Subject: [PATCH 1/7] Replace Rails logger to JSON output We added a custom formatter to rails logger so that it logs out in JSON format. By doing this we no longer need to redirect stdout to stderr, so we remove that piece of logic. Thus now logs from both Rails.logger and logstasher are sent to stdout. Co-authored-by: Neamah Al Selwi --- lib/govuk_app_config/govuk_json_logging.rb | 9 ++++++-- spec/lib/govuk_json_logging_spec.rb | 25 ++++++++++++---------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/lib/govuk_app_config/govuk_json_logging.rb b/lib/govuk_app_config/govuk_json_logging.rb index a30b7ce..eeaf830 100644 --- a/lib/govuk_app_config/govuk_json_logging.rb +++ b/lib/govuk_app_config/govuk_json_logging.rb @@ -25,8 +25,13 @@ def self.configure $stdout.sync = true # rubocop:enable Style/GlobalVars - # Send Rails' logs to STDERR because they're not JSON formatted. - Rails.logger = ActiveSupport::TaggedLogging.new(Logger.new($stderr, level: Rails.logger.level)) + Rails.logger = Logger.new( + $real_stdout, # rubocop:disable Style/GlobalVars + level: Rails.logger.level, + formatter: proc { |_severity, datetime, _progname, msg| + "#{msg.is_a?(JSON) ? { **msg, govuk_request_id: 'blah' }.to_json : JSON.dump(timestamp: datetime.to_s, message: msg)}\n" + }, + ) LogStasher.add_custom_fields do |fields| # Mirrors Nginx request logging, e.g. GET /path/here HTTP/1.1 diff --git a/spec/lib/govuk_json_logging_spec.rb b/spec/lib/govuk_json_logging_spec.rb index 3f1ec9c..6fde492 100644 --- a/spec/lib/govuk_json_logging_spec.rb +++ b/spec/lib/govuk_json_logging_spec.rb @@ -15,21 +15,23 @@ after { Rails.application = nil } - old_stderr = nil + original_stderr = nil let(:fake_stdout) { StringIO.new } + let(:fake_stderr) { StringIO.new } let(:info_log_level) { 1 } before do - old_stderr = $stderr - $stderr = StringIO.new + original_stderr = $stderr + $stderr = fake_stderr allow($stdout).to receive(:clone).and_return(fake_stdout) allow($stdout).to receive(:reopen) Rails.logger = Logger.new(fake_stdout, level: info_log_level) + end after do - $stderr = old_stderr + $stderr = original_stderr end describe ".configure" do @@ -59,9 +61,9 @@ GovukJsonLogging.configure logger = Rails.logger logger.info("test default log entry") - $stderr.rewind + fake_stdout.rewind - expect($stderr.read).to match(/test default log entry/) + expect(fake_stdout.read).to match(/test default log entry/) end describe "when making requests to the application" do @@ -74,18 +76,19 @@ def app it "logs errors thrown by the application" do GovukJsonLogging.configure get "/error" - $stderr.rewind - lines = $stderr.read.split("\n") + fake_stdout.rewind + lines = fake_stdout.read.split("\n") expect(lines).to include(/default exception/) error_log_line = lines.find { |log| log.match?(/default exception/) } expect(error_log_line).not_to be_empty error_log_json = JSON.parse(error_log_line) - expect(error_log_json).to match(hash_including( + error_log_json_msg = JSON.parse(error_log_json["message"]) + expect(error_log_json_msg).to match(hash_including( "exception_class" => "StandardError", "exception_message" => "default exception", )) - expect(error_log_json).to have_key("stacktrace") - expect(error_log_json["stacktrace"]).to be_a(Array) + expect(error_log_json_msg).to have_key("stacktrace") + expect(error_log_json_msg["stacktrace"]).to be_a(Array) end end end From 5836a2edc58dd6ffaeeb0a9d92b7afffce2f873e Mon Sep 17 00:00:00 2001 From: Neamah Al-Selwi Date: Fri, 16 Jun 2023 14:33:51 +0100 Subject: [PATCH 2/7] Change the default logger to include govuk_request_id. We have added govuk_request_id to the logs. This is to increase traceability. Also, we changed the logs to log into json format and send them to stdout and show them in kibabna logs and doesn't send the logs into stderr. Co-authored-by: Iris Lau Co-authored-by: Tuomas Nylund --- lib/govuk_app_config/govuk_json_logging.rb | 23 +++++++++- spec/lib/govuk_json_logging_spec.rb | 53 ++++++++++++++++++++-- 2 files changed, 70 insertions(+), 6 deletions(-) diff --git a/lib/govuk_app_config/govuk_json_logging.rb b/lib/govuk_app_config/govuk_json_logging.rb index eeaf830..8693126 100644 --- a/lib/govuk_app_config/govuk_json_logging.rb +++ b/lib/govuk_app_config/govuk_json_logging.rb @@ -1,3 +1,4 @@ +require "json" require "logstasher" require "action_controller" require_relative "rails_ext/action_dispatch/debug_exceptions" @@ -28,8 +29,26 @@ def self.configure Rails.logger = Logger.new( $real_stdout, # rubocop:disable Style/GlobalVars level: Rails.logger.level, - formatter: proc { |_severity, datetime, _progname, msg| - "#{msg.is_a?(JSON) ? { **msg, govuk_request_id: 'blah' }.to_json : JSON.dump(timestamp: datetime.to_s, message: msg)}\n" + formatter: proc { |severity, datetime, _progname, msg| + + begin + message = JSON.parse(msg) + rescue JSON::ParserError, TypeError => _e + message = msg + end + + hash = { + "@timestamp": datetime.utc.iso8601(3), + message: message, + level: severity, + tags: %w[rails], + } + + if defined?(GdsApi::GovukHeaders) && !GdsApi::GovukHeaders.headers[:govuk_request_id].nil? + hash[:govuk_request_id] = GdsApi::GovukHeaders.headers[:govuk_request_id] + end + + "#{hash.to_json}\n" }, ) diff --git a/spec/lib/govuk_json_logging_spec.rb b/spec/lib/govuk_json_logging_spec.rb index 6fde492..519c173 100644 --- a/spec/lib/govuk_json_logging_spec.rb +++ b/spec/lib/govuk_json_logging_spec.rb @@ -4,6 +4,13 @@ require "rack/test" RSpec.describe GovukJsonLogging do + let(:govuk_headers_class) do + Class.new do + def self.headers + { govuk_request_id: "some-value" } + end + end + end before do stub_const("DummyLoggingRailsApp", Class.new(Rails::Application) do config.hosts.clear @@ -74,6 +81,7 @@ def app end it "logs errors thrown by the application" do + stub_const("GdsApi::GovukHeaders", govuk_headers_class) GovukJsonLogging.configure get "/error" fake_stdout.rewind @@ -81,15 +89,52 @@ def app expect(lines).to include(/default exception/) error_log_line = lines.find { |log| log.match?(/default exception/) } expect(error_log_line).not_to be_empty + error_log_json = JSON.parse(error_log_line) - error_log_json_msg = JSON.parse(error_log_json["message"]) - expect(error_log_json_msg).to match(hash_including( - "exception_class" => "StandardError", - "exception_message" => "default exception", + expect(error_log_json).to match(hash_including( + "govuk_request_id" => "some-value", )) + + error_log_json_msg = error_log_json["message"] + expect(error_log_json_msg).to match(hash_including( + "exception_class" => "StandardError", + "exception_message" => "default exception", + )) + expect(error_log_json_msg).to have_key("stacktrace") + expect(error_log_json_msg["stacktrace"]).to be_a(Array) + end + + it "logs errors thrown by the application with no govuk_request_id" do + GovukJsonLogging.configure + get "/error" + fake_stdout.rewind + lines = fake_stdout.read.split("\n") + expect(lines).to include(/default exception/) + error_log_line = lines.find { |log| log.match?(/default exception/) } + expect(error_log_line).not_to be_empty + error_log_json = JSON.parse(error_log_line) + error_log_json_msg = error_log_json["message"] + expect(error_log_json_msg).to match(hash_including( + "exception_class" => "StandardError", + "exception_message" => "default exception", + )) expect(error_log_json_msg).to have_key("stacktrace") expect(error_log_json_msg["stacktrace"]).to be_a(Array) end + + it "logs to stdout in JSON format with govuk_request_id" do + stub_const("GdsApi::GovukHeaders", govuk_headers_class) + GovukJsonLogging.configure + logger = Rails.logger + logger.info("test default log entry") + fake_stdout.rewind + log_line = fake_stdout.read + log_json = JSON.parse(log_line) + + expect(log_json).to include("message" => "test default log entry") + expect(log_json).to include("govuk_request_id" => "some-value") + + end end end end From 0a6f772744fd268caeb1e5e8d923e4a6c310a977 Mon Sep 17 00:00:00 2001 From: Iris Lau Date: Wed, 21 Jun 2023 16:52:22 +0100 Subject: [PATCH 3/7] Remove the rewiring stdout and strerr logic The redirection was a workaround for log file parsers and it is no longer needed. So we remove that part and simplify the logger settings. Co-authored-by: Neamah Al-Selwi Co-authored-by: Tuomas Nylund --- README.md | 3 --- lib/govuk_app_config/govuk_json_logging.rb | 22 ++-------------------- spec/lib/govuk_json_logging_spec.rb | 10 +++++----- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index f67a311..6aaccab 100644 --- a/README.md +++ b/README.md @@ -142,9 +142,6 @@ check docs](docs/healthchecks.md) for more information on how to use it. ## Rails logging -In Rails applications, the application will be configured to send JSON-formatted -logs to `STDOUT` and unstructured logs to `STDERR`. - To enable production-like logging, an env variable `GOVUK_RAILS_JSON_LOGGING` is set in the `govuk-helm-charts` and then checked in `railtie.rb`. This will allow JSON format logs and `Govuk-Request-Id` to be visible. diff --git a/lib/govuk_app_config/govuk_json_logging.rb b/lib/govuk_app_config/govuk_json_logging.rb index 8693126..7b6fb0f 100644 --- a/lib/govuk_app_config/govuk_json_logging.rb +++ b/lib/govuk_app_config/govuk_json_logging.rb @@ -5,32 +5,14 @@ module GovukJsonLogging def self.configure - # GOV.UK Rails applications are expected to output JSON to stdout which is - # then indexed in a Kibana instance. These log outputs are created by the - # logstasher gem. - # - # Rails applications will typically write other things to stdout such as - # `Rails.logger` calls or 'puts' statements. However these are not in a - # JSON format which causes problems for the log file parsers. - # - # To resolve this we redirect stdout to stderr, to cover any Rails - # writing. This frees up the normal stdout for the logstasher logs. - # # We also disable buffering, so that logs aren't lost on crash or delayed # indefinitely while troubleshooting. - - # rubocop:disable Style/GlobalVars - $real_stdout = $stdout.clone - $real_stdout.sync = true - $stdout.reopen($stderr) $stdout.sync = true - # rubocop:enable Style/GlobalVars Rails.logger = Logger.new( - $real_stdout, # rubocop:disable Style/GlobalVars + $stdout, level: Rails.logger.level, formatter: proc { |severity, datetime, _progname, msg| - begin message = JSON.parse(msg) rescue JSON::ParserError, TypeError => _e @@ -77,7 +59,7 @@ def self.configure Rails.application.config.logstasher.source = {} Rails.application.config.logstasher.logger = Logger.new( - $real_stdout, # rubocop:disable Style/GlobalVars + $stdout, level: Rails.logger.level, formatter: proc { |_severity, _datetime, _progname, msg| "#{msg.is_a?(String) ? msg : msg.inspect}\n" diff --git a/spec/lib/govuk_json_logging_spec.rb b/spec/lib/govuk_json_logging_spec.rb index 519c173..25ac701 100644 --- a/spec/lib/govuk_json_logging_spec.rb +++ b/spec/lib/govuk_json_logging_spec.rb @@ -23,6 +23,7 @@ def self.headers after { Rails.application = nil } original_stderr = nil + original_stdout = nil let(:fake_stdout) { StringIO.new } let(:fake_stderr) { StringIO.new } @@ -30,15 +31,15 @@ def self.headers before do original_stderr = $stderr + original_stdout = $stdout $stderr = fake_stderr - allow($stdout).to receive(:clone).and_return(fake_stdout) - allow($stdout).to receive(:reopen) + $stdout = fake_stdout Rails.logger = Logger.new(fake_stdout, level: info_log_level) - end after do $stderr = original_stderr + $stdout = original_stdout end describe ".configure" do @@ -80,7 +81,7 @@ def app Rails.application end - it "logs errors thrown by the application" do + it "logs errors thrown by the application with govuk_request_id" do stub_const("GdsApi::GovukHeaders", govuk_headers_class) GovukJsonLogging.configure get "/error" @@ -133,7 +134,6 @@ def app expect(log_json).to include("message" => "test default log entry") expect(log_json).to include("govuk_request_id" => "some-value") - end end end From e13795b41e7b99351ee35200d23eab623b2ed5f4 Mon Sep 17 00:00:00 2001 From: Iris Lau Date: Tue, 27 Jun 2023 15:04:17 +0100 Subject: [PATCH 4/7] Log error in a full string instead of json In order to avoid complexity around parsing JSON, we log errors in one full string now Co-authored-by: Neamah Al-Selwi Co-authored-by: Tuomas Nylund --- lib/govuk_app_config/govuk_json_logging.rb | 8 +------ .../action_dispatch/debug_exceptions.rb | 7 ++---- spec/lib/govuk_json_logging_spec.rb | 22 +++++++++---------- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/lib/govuk_app_config/govuk_json_logging.rb b/lib/govuk_app_config/govuk_json_logging.rb index 7b6fb0f..66d23af 100644 --- a/lib/govuk_app_config/govuk_json_logging.rb +++ b/lib/govuk_app_config/govuk_json_logging.rb @@ -13,15 +13,9 @@ def self.configure $stdout, level: Rails.logger.level, formatter: proc { |severity, datetime, _progname, msg| - begin - message = JSON.parse(msg) - rescue JSON::ParserError, TypeError => _e - message = msg - end - hash = { "@timestamp": datetime.utc.iso8601(3), - message: message, + message: msg, level: severity, tags: %w[rails], } diff --git a/lib/govuk_app_config/rails_ext/action_dispatch/debug_exceptions.rb b/lib/govuk_app_config/rails_ext/action_dispatch/debug_exceptions.rb index 3a38271..70c0bb7 100644 --- a/lib/govuk_app_config/rails_ext/action_dispatch/debug_exceptions.rb +++ b/lib/govuk_app_config/rails_ext/action_dispatch/debug_exceptions.rb @@ -38,12 +38,9 @@ def log_error(request, wrapper) trace = wrapper.application_trace trace = wrapper.framework_trace if trace.empty? + exception.set_backtrace(trace) - logger.fatal({ - exception_class: exception.class.to_s, - exception_message: exception.message, - stacktrace: trace, - }.to_json) + logger.fatal(exception.full_message) end end end diff --git a/spec/lib/govuk_json_logging_spec.rb b/spec/lib/govuk_json_logging_spec.rb index 25ac701..03087d7 100644 --- a/spec/lib/govuk_json_logging_spec.rb +++ b/spec/lib/govuk_json_logging_spec.rb @@ -22,6 +22,10 @@ def self.headers after { Rails.application = nil } + # By storing origin stdout in a constant and redirect `$stdout` to a fake one, + # We are able to inspect and test what is printed + # BUT it also suppress all the normal log outputs + # I.E. puts doesn't work anymore :D original_stderr = nil original_stdout = nil @@ -97,12 +101,9 @@ def app )) error_log_json_msg = error_log_json["message"] - expect(error_log_json_msg).to match(hash_including( - "exception_class" => "StandardError", - "exception_message" => "default exception", - )) - expect(error_log_json_msg).to have_key("stacktrace") - expect(error_log_json_msg["stacktrace"]).to be_a(Array) + expect(error_log_json_msg).to include("StandardError") + expect(error_log_json_msg).to include("default exception") + expect(error_log_json_msg).to match(/from.*:[0-9]+:in.*/) end it "logs errors thrown by the application with no govuk_request_id" do @@ -115,12 +116,9 @@ def app expect(error_log_line).not_to be_empty error_log_json = JSON.parse(error_log_line) error_log_json_msg = error_log_json["message"] - expect(error_log_json_msg).to match(hash_including( - "exception_class" => "StandardError", - "exception_message" => "default exception", - )) - expect(error_log_json_msg).to have_key("stacktrace") - expect(error_log_json_msg["stacktrace"]).to be_a(Array) + expect(error_log_json_msg).to include("StandardError") + expect(error_log_json_msg).to include("default exception") + expect(error_log_json_msg).to match(/from.*:[0-9]+:in.*/) end it "logs to stdout in JSON format with govuk_request_id" do From 5b80c3c714cacb02e49db7847e72503327975d5f Mon Sep 17 00:00:00 2001 From: Iris Lau Date: Thu, 29 Jun 2023 15:14:27 +0100 Subject: [PATCH 5/7] Remove Monkeypatching A monkeypatch in RailsExt::ActionDispatch existed to convert errors to pretty JSON. Now that we have set the default logger to log in JSON the transformed error message becomes a stringified JSON and not the best for error viewing. By removing the monkeypatch it should logs error nicely via logger we set. Co-authored-by: Neamah Al-Selwi Co-authored-by: Tuomas Nylund --- lib/govuk_app_config/govuk_json_logging.rb | 5 +- .../action_dispatch/debug_exceptions.rb | 49 ------------------- spec/lib/govuk_json_logging_spec.rb | 4 +- .../action_dispatch/debug_exceptions_spec.rb | 48 ------------------ 4 files changed, 3 insertions(+), 103 deletions(-) delete mode 100644 lib/govuk_app_config/rails_ext/action_dispatch/debug_exceptions.rb delete mode 100644 spec/lib/rails_ext/action_dispatch/debug_exceptions_spec.rb diff --git a/lib/govuk_app_config/govuk_json_logging.rb b/lib/govuk_app_config/govuk_json_logging.rb index 66d23af..3fab414 100644 --- a/lib/govuk_app_config/govuk_json_logging.rb +++ b/lib/govuk_app_config/govuk_json_logging.rb @@ -1,11 +1,10 @@ require "json" require "logstasher" require "action_controller" -require_relative "rails_ext/action_dispatch/debug_exceptions" module GovukJsonLogging def self.configure - # We also disable buffering, so that logs aren't lost on crash or delayed + # We disable buffering, so that logs aren't lost on crash or delayed # indefinitely while troubleshooting. $stdout.sync = true @@ -68,7 +67,5 @@ def self.configure # the responses it gets, so direct this to the logstasher logger. GdsApi::Base.default_options[:logger] = Rails.application.config.logstasher.logger end - - RailsExt::ActionDispatch.monkey_patch_log_error if RailsExt::ActionDispatch.should_monkey_patch_log_error? end end diff --git a/lib/govuk_app_config/rails_ext/action_dispatch/debug_exceptions.rb b/lib/govuk_app_config/rails_ext/action_dispatch/debug_exceptions.rb deleted file mode 100644 index 70c0bb7..0000000 --- a/lib/govuk_app_config/rails_ext/action_dispatch/debug_exceptions.rb +++ /dev/null @@ -1,49 +0,0 @@ -require "action_dispatch/middleware/debug_exceptions" - -module GovukJsonLogging - module RailsExt - module ActionDispatch - def self.should_monkey_patch_log_error?(clazz = ::ActionDispatch::DebugExceptions) - empty_instance = clazz.new nil - target_method = empty_instance.method :log_error - - expected_parameters = [%i[req request], %i[req wrapper]] - actual_parameters = target_method.parameters - - should_monkey_patch = actual_parameters == expected_parameters - - unless should_monkey_patch - Rails.logger.warn "Refused to monkey patch ::ActionDispatch::DebugExceptions#log_error - " \ - "signatures do not match. " \ - "Expected #{expected_parameters}, but got #{actual_parameters}" - end - - should_monkey_patch - rescue StandardError => e - Rails.logger.warn "Failed to detect whether to monkey patch " \ - "::ActionDispatch::DebugExceptions#log_error - #{e.inspect}" - false - end - - def self.monkey_patch_log_error(clazz = ::ActionDispatch::DebugExceptions) - clazz.class_eval do - private - - def log_error(request, wrapper) - logger = logger(request) - - return unless logger - - exception = wrapper.exception - - trace = wrapper.application_trace - trace = wrapper.framework_trace if trace.empty? - exception.set_backtrace(trace) - - logger.fatal(exception.full_message) - end - end - end - end - end -end diff --git a/spec/lib/govuk_json_logging_spec.rb b/spec/lib/govuk_json_logging_spec.rb index 03087d7..d25d18a 100644 --- a/spec/lib/govuk_json_logging_spec.rb +++ b/spec/lib/govuk_json_logging_spec.rb @@ -103,7 +103,7 @@ def app error_log_json_msg = error_log_json["message"] expect(error_log_json_msg).to include("StandardError") expect(error_log_json_msg).to include("default exception") - expect(error_log_json_msg).to match(/from.*:[0-9]+:in.*/) + expect(error_log_json_msg).to match(/[a-zA-Z]+.*:[0-9]+:in.*/) end it "logs errors thrown by the application with no govuk_request_id" do @@ -118,7 +118,7 @@ def app error_log_json_msg = error_log_json["message"] expect(error_log_json_msg).to include("StandardError") expect(error_log_json_msg).to include("default exception") - expect(error_log_json_msg).to match(/from.*:[0-9]+:in.*/) + expect(error_log_json_msg).to match(/[a-zA-Z].*:[0-9]+:in.*/) end it "logs to stdout in JSON format with govuk_request_id" do diff --git a/spec/lib/rails_ext/action_dispatch/debug_exceptions_spec.rb b/spec/lib/rails_ext/action_dispatch/debug_exceptions_spec.rb deleted file mode 100644 index ef85ddf..0000000 --- a/spec/lib/rails_ext/action_dispatch/debug_exceptions_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -require "spec_helper" -require "rails" -require "govuk_app_config/rails_ext/action_dispatch/debug_exceptions" - -RSpec.describe ::GovukJsonLogging::RailsExt::ActionDispatch do - describe "#should_monkey_patch_log_error?" do - before do - Rails.logger = double(:rails_logger) - allow(Rails.logger).to receive(:warn) - end - - after do - Rails.logger = nil - end - - it "should not monkey patch classes which do not have log_error" do - no_method_test_class = Class.new - expect(described_class.should_monkey_patch_log_error?(no_method_test_class)).to be(false) - end - - it "should not monkey patch classes which have log_error with different params" do - wrong_parameters_test_class = Class.new do - def log_error(_different, _parameters); end - end - expect(described_class.should_monkey_patch_log_error?(wrong_parameters_test_class)).to be(false) - end - - it "should monkey patch classes which have log_error with the same params" do - right_parameters_test_class = Class.new do - def log_error(request, wrapper); end - end - expect(described_class.should_monkey_patch_log_error?(right_parameters_test_class)).to be(false) - end - end - - describe "#monkey_patch_log_error" do - it "should replace the private log_error method" do - fake_debug_exceptions = Class.new do - def log_error(request, wrapper); end - end - instance = fake_debug_exceptions.new - - expect { - described_class.monkey_patch_log_error(fake_debug_exceptions) - }.to(change { instance.method(:log_error) }) - end - end -end From 3f7a9b9710ed3af71deec969a5dfa592cc3bdc32 Mon Sep 17 00:00:00 2001 From: Iris Lau Date: Thu, 22 Jun 2023 16:53:57 +0100 Subject: [PATCH 6/7] Update CHANGELOG.md Co-authored-by: Ollie Treend Co-authored-by: Neamah Al-Selwi Co-authored-by: Tuomas Nylund --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c0cab3..1c41012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Unreleased * BREAKING: JSON logs are no longer configured automatically for production Rails apps and are turned on with the GOVUK_RAILS_JSON_LOGGING environment variable ([#302](https://github.com/alphagov/govuk_app_config/pull/302)) +* Add govuk_request_id to JSON logging for apps with gds-api-adapters ([#300](https://github.com/alphagov/govuk_app_config/pull/300)) +* BREAKING: Remove $stdout, $stderr and $real_stdout redirections ([#300](https://github.com/alphagov/govuk_app_config/pull/300)) +* BREAKING: Change error log behaviour from logging JSON to full string ([#300](https://github.com/alphagov/govuk_app_config/pull/300)) +* Remove monkeypatch for errors ([#300](https://github.com/alphagov/govuk_app_config/pull/300)) # 8.1.1 From 6408b624a2c441ce27534e52fa6a5921c467ea46 Mon Sep 17 00:00:00 2001 From: Iris Lau Date: Wed, 5 Jul 2023 11:57:29 +0100 Subject: [PATCH 7/7] Bump version 9.0.0 Co-authored-by: Neamah Al-Selwi Co-authored-by: Tuomas Nylund Co-authored-by: Laura Ghiorghisor --- CHANGELOG.md | 2 +- lib/govuk_app_config/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c41012..319168f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Unreleased +# 9.0.0 * BREAKING: JSON logs are no longer configured automatically for production Rails apps and are turned on with the GOVUK_RAILS_JSON_LOGGING environment variable ([#302](https://github.com/alphagov/govuk_app_config/pull/302)) * Add govuk_request_id to JSON logging for apps with gds-api-adapters ([#300](https://github.com/alphagov/govuk_app_config/pull/300)) diff --git a/lib/govuk_app_config/version.rb b/lib/govuk_app_config/version.rb index b89202b..b2d45dd 100644 --- a/lib/govuk_app_config/version.rb +++ b/lib/govuk_app_config/version.rb @@ -1,3 +1,3 @@ module GovukAppConfig - VERSION = "8.1.1".freeze + VERSION = "9.0.0".freeze end