This project is archived and is in readonly mode.

#6071 ✓stale
Fjan

Inconvenient Time stamp format in logger

Reported by Fjan | November 26th, 2010 @ 02:38 PM

The Rails logger in 3.0.3 was changed to put Time.now.to_default_s on every log action which produces something like "Fri Nov 26 15:17:39 +0100 2010". This is really inconvenient for scripts that automatically process logs.

I propose we change this to simply Time.now.to_s, that will have the same output but allows the user to set his own format in the config files with Time::DATE_FORMATS[:default] = "%Y-%m-%d %H:%M:%S"

(An alternative would be to use Time.now.to_s(:db) which is the more convenient Rails 2 format)

Comments and changes to this ticket

  • Neeraj Singh

    Neeraj Singh November 26th, 2010 @ 03:50 PM

    • Importance changed from “” to “Low”

    I will say leave the formatting the way it is so that fix won't break any existing app. However allow users to configure it.

  • Fjan

    Fjan November 26th, 2010 @ 03:55 PM

    I agree. That still leaves us with the choice to leave it the way it was in Rails 2 or to leave it the way it is now in Rails 3. The latter allows us to more easily make it user configurable so that's probably preferred.

  • rails

    rails March 1st, 2011 @ 12:00 AM

    • State changed from “new” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails March 1st, 2011 @ 12:00 AM

    • State changed from “open” to “stale”
  • bingbing

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages