lib/timber/config.rb in timber-2.0.0 vs lib/timber/config.rb in timber-2.0.1
- old
+ new
@@ -25,10 +25,11 @@
attr_writer :capture_http_bodies, :debug_logger, :log_formatter, :logger
def initialize
@capture_http_bodies = true
@capture_http_body_content_types = [FORM_URL_ENCODED_CONTENT_TYPE, JSON_CONTENT_TYPE]
+ @http_body_limit = 2000
end
# Enables and disables the capturing of HTTP bodies in `Events::HTTPServerRequest`,
# `HTTPClientRequest`, and `HTTPClientRespone`.
def capture_http_bodies?
@@ -45,9 +46,15 @@
# written to this logger.
def debug_logger
@debug_logger
end
+ # Truncates captured HTTP bodies to this specified limit. The default is `2000`.
+ # If you want to capture more data, you can raise this to a maximum of `5000`,
+ # or lower this to be more efficient with data.
+ def http_body_limit
+ @http_body_limit
+ end
# This is the logger Timber writes to. It should be set to your global
# logger to keep the logging destination consitent. Please see `delegate_logger_to`
# to delegate this call to another method. This is set to `Rails.logger`
# for rails.
\ No newline at end of file