Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent of Log4J for Ruby, Log4Ruby?

Tags:

logging

ruby

I looked around and couldn't find one. Is there an equivalent of Log4X for Ruby? If not what's the best way to handle all the debug statements. I'm fairly new to Ruby.

Thanks!

like image 490
Chumpboy Avatar asked Apr 09 '09 18:04

Chumpboy


1 Answers

Ruby comes with a built in logging library, but there's log4r.

A short example of the built in library:

#!/usr/bin/env ruby
require 'logger'

log = Logger.new('mylog.txt')
log.debug "Hello log"
like image 64
dommer Avatar answered Nov 17 '22 19:11

dommer