From: John W Higgins Date: 2010-03-04T07:11:55+09:00 Subject: Re: Logger datetime_format not respected --000e0cd355fc16b7e50480ecc5a8 Content-Type: text/plain; charset=ISO-8859-1 Afternoon again, On Wed, Mar 3, 2010 at 2:05 PM, Karl wrote: > My fault, copied the wrong version: > > require 'logger' > log = Logger.new(STDOUT) > log.datetime_format = "%Y-%m-%d %H:%M:%S" > log.formatter = proc { |severity, datetime, progname, msg| > "[#{datetime}] #{msg}\n" > } > log.info "#{log.datetime_format}" > > outputs: > > [Wed Mar 03 15:01:05 -0700 2010] %Y-%m-%d %H:%M:%S > > > > So what you've done is changed the format but then changed the formatter so it never uses the datetime_format Change your proc code to this and you should be ok..... log.formatter = proc { |severity, datetime, progname, msg| "[#{datetime.strftime(log.datetime_format)}] #{msg}\n" } John --000e0cd355fc16b7e50480ecc5a8--