From f86d61dff5ca4c76bc9e120e26bdb2ffca51d0a9 Mon Sep 17 00:00:00 2001 From: Wendel Fabian Chinsamy Date: Tue, 21 May 2024 14:10:23 +0200 Subject: [PATCH] reconfigure logging --- Gemfile | 13 ++++++------- config/application.rb | 9 +++++---- config/environments/development.rb | 7 ------- config/routes.rb | 6 +++--- public/favicon.png | Bin 0 -> 1257 bytes 5 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 public/favicon.png diff --git a/Gemfile b/Gemfile index 18b55cb..792c788 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" gem "rails", "~> 7.1", ">= 7.1.3" -gem "bootsnap", "~> 1.4" +gem "bootsnap", "~> 1.4", ">= 1.4.4", require: false gem "mysql2", "~> 0.5.3" gem "dotenv" gem "oj", ">= 2.8.3" @@ -11,7 +11,7 @@ gem "nokogiri", "~> 1.16", ">= 1.16.4" gem "iso8601", "~> 0.12.1" gem "maremma", "~> 5.0" gem "dalli", "~> 3.2", ">= 3.2.8" -gem "lograge", "~> 0.11.2" +gem "lograge", "~> 0.14.0" gem "logstash-event", "~> 1.2", ">= 1.2.02" gem "logstash-logger", "~> 0.26.1" gem "active_model_serializers", "~> 0.10.10" @@ -35,11 +35,11 @@ gem "sprockets", "~> 3.7", ">= 3.7.2" gem "kt-paperclip", "~> 6.4.1" group :development, :test do - gem "rspec-rails", "~> 3.8" - gem "rubocop-rspec", "~> 1.35" - gem "rubocop", "~> 0.77.0" + gem "rspec-rails", "~> 6.1", ">= 6.1.1" + gem "rubocop-rspec", "~> 2.0", require: false + gem "rubocop", "~> 1.3", ">= 1.3.1" gem "rubocop-performance", "~> 1.5", ">= 1.5.1" - gem "rubocop-rails", "~> 2.4" + gem "rubocop-rails", "~> 2.8", ">= 2.8.1" gem "binding_of_caller" gem "byebug", platforms: [:mri, :mingw, :x64_mingw] end @@ -48,7 +48,6 @@ group :development do gem "listen", "~> 3.9" gem "spring" gem "spring-watcher-listen", "~> 2.0.0" - gem "httplog", "~> 1.3" end group :test do diff --git a/config/application.rb b/config/application.rb index 8889e4c..b24ca98 100644 --- a/config/application.rb +++ b/config/application.rb @@ -78,10 +78,11 @@ class Application < Rails::Application config.logger = config.lograge.logger config.log_level = ENV["LOG_LEVEL"].to_sym - config.lograge.ignore_actions = ["HeartbeatController#index", "IndexController#index"] - config.lograge.ignore_custom = lambda do |event| - event.payload.inspect.length > 100000 - end + # config.lograge.ignore_actions = ["HeartbeatController#index", "IndexController#index"] + # config.lograge.ignore_custom = lambda do |event| + # event.payload.inspect.length > 100000 + # end + config.lograge.base_controller_class = "ActionController::API" config.lograge.custom_options = lambda do |event| diff --git a/config/environments/development.rb b/config/environments/development.rb index 719714b..86f13ae 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -30,13 +30,6 @@ config.action_controller.perform_caching = true config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"], { namespace: ENV["APPLICATION"] } - HttpLog.configure do |config| - config.enabled = false - config.logger = LogStashLogger.new(type: :stdout) - config.url_blacklist_pattern = /sqs\.eu-west-1\.amazonaws\.com/ - config.filter_parameters = %w(client_id access_token orcid_token) - end - # Don't care if the mailer can't send. # config.action_mailer.raise_delivery_errors = false diff --git a/config/routes.rb b/config/routes.rb index 799eb14..4040ab0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,14 +2,12 @@ root :to => 'index#index' resources :heartbeat, only: [:index] resources :index, path: '/', only: [:index] - # resources :index, only: [:index] def add_swagger_route http_method, path, opts = {} full_path = path.gsub(/{(.*?)}/, ':\1') match full_path, to: "#{opts.fetch(:controller_name)}##{opts[:action_name]}", via: http_method end - # add_swagger_route 'GET', '//reports/publishers', controller_name: 'publishers', action_name: 'index' add_swagger_route 'DELETE', '//publishers/{id}', controller_name: 'publishers', action_name: 'destroy' add_swagger_route 'PUT', '//publishers/{id}', controller_name: 'publishers', action_name: 'update' add_swagger_route 'POST', '//publishers', controller_name: 'publishers', action_name: 'create' @@ -25,7 +23,9 @@ def add_swagger_route http_method, path, opts = {} get 'repositories-usage-reports/:id', :to => 'publishers#show', constraints: { :id => /.+/ } - resources :publishers, constraints: { :id => /.+/ }, format: false, defaults: { format: false } resources :repositories_usage_reports, constraints: { :id => /.+/ }, format: false, defaults: { format: false } + + get '/public/favicon.ico', to: redirect('/public/favicon.ico') + get '/favicon.ico', to: redirect('/public/favicon.ico') end diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd1a8068966e64173ca20f7be2cddc8867991c4 GIT binary patch literal 1257 zcmV=P)LkIk|s;7 zq_-Y?QMy4lqnIeQ8yV6Kf(T4SGHs-b1wQmpNOveRD2ke~BCD}T9kcmj#ec)%u=hFV zn>lB`Z=^qL<~w_>z0O`|uf5h@YY+U7BNLrKFR&We2J8lY0}iR#?=OJ?U=`4#F>Qe< zn*1i;DD#(eb?n%&J?7CBPqU0=MYP+w+K4DT}Nk0cK8riFPNjTrwNL zKH&N~6fpaJ$W3Z1FcY{8_(yGiVr)v0pv>QD-IBS*jp?siiKm_EEK~pS+6xUS$ruzd z+$H+gK!^I4In!HPl_Fs!_GdQZYW2SlOdp3LQ-Sxyv%>XXqjy%aGD{@LOsCKFpC;F7 zw0Q+GiWD)-0YVJRa{9Humiq+QaI%z()m&7+w+IeVP8-)IU5{Z}!F* z0$kl~d$UR`Y=cQR63v@5kMbYjpDX*+)A(;)}xd?5!XrGil&h%=)kaLFt zCSZ@~=hUFcx#G2BOcpkmLD8=)BWzQ|6$YFonjI;qK@r2x;*V|Y6{2k@5^|i}s=30h z2>m7rvglivB3s2DJEC-HZWdo=lrgKF3HoCR7g?nu_lw_hmKb)5enp;;5Up*(F}#}d zwW?C&2JxGT$MCr5EAxbG6H_WL_*nD{YgFVS@qdt@Unlx&c|yJt(|HMcNQ%y^QIT2V z|29FNE4ro4N$eHVNeTMzqMuNsBAvjWdRGi5OP=K}NsLTzlun@=__bi{!O5UV2#z86 z#+uEwElq0&@S#$KJj|3lD=#In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