# Timestamps on log files

**URL:** <https://www.ruby-forum.com/t/timestamps-on-log-files/192063>\
**Category:** Rails\
**Created:** [July 23, 2010, 4:34am UTC](https://www.ruby-forum.com/t/timestamps-on-log-files/192063 "2010-07-23T04:34:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian\_ASEspind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e8c25b/32.png) [@Sebastian\_ASEspind](https://www.ruby-forum.com/u/Sebastian_ASEspind)\
**Post date:** [July 23, 2010, 4:34am UTC](https://www.ruby-forum.com/t/timestamps-on-log-files/192063/1 "2010-07-23T04:34:50Z")

</div>

Hello people,  
I’m currently reading the innards of Arel and ActiveRecord and  
thought of modifying the  
ActiveSupport::BufferedLogger to automatically prepend a timestamp  
on each log entry.  
Would be very useful for a project I’m currently developing.

I’m going to make it a configurable option in applications.rb,  
something like:

config.logger.timestamps =\> true

Is there any interest in having this in the rails core?  
If it is, I could easily submit a patch. I have contributed to  
ActiveRecord in the past.[1]

Let me know what you think.

Regards,  
Sebastian.

1:

> <https://github.com/rails/rails/commit/0176e6adb388998414083e99523de318d3b8ca49>
>
> Signed-off-by: Pratik Naik \<pratiknaik@gmail.com\>

---

<div class="post-metadata">

**Author:** ![Sebastian\_ASEspind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e8c25b/32.png) [@Sebastian\_ASEspind](https://www.ruby-forum.com/u/Sebastian_ASEspind)\
**Post date:** [July 23, 2010, 5:01pm UTC](https://www.ruby-forum.com/t/timestamps-on-log-files/192063/2 "2010-07-23T17:01:11Z")

</div>

On Thu, Jul 22, 2010 at 7:32 PM, Sebastian A. Espindola  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> thought of modifying the  
> ActiveSupport::BufferedLogger to automatically prepend a timestamp  
> on each log entry.

+1 – I did that once myself for a project, but it was hard-wired.

> I’m going to make it a configurable option in applications.rb …

Configurable sounds good 🙂

> Is there any interest in having this in the rails core?

I’d like to see it added.

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan
