Duplicating log4j_logger from rails 2

Updated specs too.
Style/EmptyLinesAroundAccessModifier: Keep a blank line before and after `protected`.