From dc18ddb1d38b6a44dedfd36d9eb4498718a29385 Mon Sep 17 00:00:00 2001 From: Adrian Serafin Date: Tue, 15 Mar 2016 21:21:53 +0100 Subject: [PATCH] change readme to reflect setting formatter being optional --- README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b948f50..947abea 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ In your api file (somewhere on the top) logger.formatter = GrapeLogging::Formatters::Default.new use GrapeLogging::Middleware::RequestLogger, { logger: logger } +**ProTip:** If your logger doesn't support setting formatter you can remove this line - it's optional + ## Features ### Log Format @@ -84,14 +86,6 @@ and then add an initializer in your Rails project: The idea come from here: https://gist.github.com/teamon/e8ae16ffb0cb447e5b49 -There's some advantages to use this method: - - - You could use a logger that does not implement the ```formatter=```. - Defaults Rails 3 (ActiveSupport::BufferedLogger) does not implement it. - The Logging gem (https://github.com/TwP/logging) does not implement it neither. - - - If you use a logger that already format logs (as the Logging gem), the logs will be formatted by your logger. - ### Logging exceptions If you want to log exceptions you can do it like this