small medium large xlarge

07 Jun 2017, 06:17
Garth Lancaster (1 post)

It provides plenty of food for thought, but, I would have liked to see more ‘Logging’ considered in it - coming from a C# background, the first 3 things I always configure in a C# app are Command-Line Parsing, Configuration & Logging. Ruby ‘Logger’ appears a bit ‘basic’ having used log4net etc, so in Ruby I’ve started using Log4r - which is great - I can log to stdout for the user and to a file for the techs, with different levels.

.. now I just have to figure out how to pass a logger from my main program into a gem (I split up my monolith into gems so I could use/deploy different functionality as required)

cheers anyway

07 Jun 2017, 13:54
David Copeland (501 posts)

Yeah, the tradition in Rails is to use Rails.logger as your logger. It’s available globally and doesn’t require injecting into any other classes (though it obviously creates a dependency on Rails).

It’s also not common in Rails-land to log excessively, though I would agree that it’s a bit odd. I did Java for many years, and logging was super important.

You must be logged in to comment