I'd like to have a simple logger as I have in Rails. Just to log all requests with all their parameters. Can's figure out how to do this. Thanks.
Asked
Active
Viewed 523 times
0
-
@nyzm I don't think so -- this asker is only looking to log requests – hdgarrood Aug 28 '13 at 16:55
2 Answers
0

hdgarrood
- 2,141
- 16
- 23
-
-
As far as I can see, the only difference between mine and yours is that mine writes to stdout and yours writes to a file called log/app.log. Is that correct? – hdgarrood Sep 03 '13 at 23:26
-
I don't know, may be my configuration is a bit different, so I was need to add thei workaround. – Benjamin Harel Sep 12 '13 at 07:41
0
Found it:
configure do
class ::Logger; alias_method :write, :<<; end
use Rack::CommonLogger, Logger.new('logs/app.log')
end
taken from here: customink/stoplight

Benjamin Harel
- 2,906
- 3
- 24
- 32
-
This monkey-patch seems unnecessary. Have you tried subclassing Logger? – hdgarrood Sep 03 '13 at 23:18