From c8c3ae8f4c98da48bf80fdf5b62acaec84dd0e64 Mon Sep 17 00:00:00 2001 From: Samnang Chhun Date: Fri, 1 Sep 2023 10:57:57 +0700 Subject: [PATCH] Twiml Endpoint Request Logging --- components/app/config/initializers/http.rb | 8 ++++++++ components/app/spec/support/http.rb | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 components/app/config/initializers/http.rb create mode 100644 components/app/spec/support/http.rb diff --git a/components/app/config/initializers/http.rb b/components/app/config/initializers/http.rb new file mode 100644 index 000000000..ee6758602 --- /dev/null +++ b/components/app/config/initializers/http.rb @@ -0,0 +1,8 @@ +# To enable logging for all request & response headers and bodies +HTTP.default_options = HTTP::Options.new( + features: { + logging: { + logger: Logger.new(STDOUT) + } + } +) diff --git a/components/app/spec/support/http.rb b/components/app/spec/support/http.rb new file mode 100644 index 000000000..764688de6 --- /dev/null +++ b/components/app/spec/support/http.rb @@ -0,0 +1,7 @@ +HTTP.default_options = HTTP::Options.new( + features: { + logging: { + logger: Logger.new(IO::NULL) + } + } +)