0

If it doesn't, what's the half-life of it?

It it does, where can find that information?

On my server I found a few logs for each of my releases. But they only date back a few days.

Specifically, I am looking for emails that were sent while my mail server was down two weeks ago.

John Topley
  • 113,588
  • 46
  • 195
  • 237
Trip
  • 26,756
  • 46
  • 158
  • 277

2 Answers2

1

Short answer: Yes, it stores indefinitely. If you cannot find the information you are looking for, you may have unknowingly truncated the log at some point, or your application is configured otherwise.


Slightly longer answer: The default logger is an instance of ActiveSupport::BufferedLogger, which is a really simple logger. Even simpler than Ruby's stock Logger class. It doesn't know about limits or rotation.

But Rails is compatible with any Ruby Logger or Log4r-like object. If the application you installed is not one of your own making, and you want to know if it's doing something different from stock Rails, you could look in your config directory to see if it's using a different logger class.

A different logger is usually configured using config.logger = [...] in config/environment.rb or config/environments/production.rb. In the default Rails application template, the latter file contains the following commented example:

# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
Stéphan Kochen
  • 19,513
  • 9
  • 61
  • 50
  • No, no special logger here. But after checking my log releases, they only go back one week. That is .. the production.log – Trip Jun 07 '10 at 20:51
0

I use:

config.logger = ActiveSupport::BufferedLogger.new(Rails.root.join("log","production.log"))

in config/environments/production.rb. And according to the apis there is a 1000 log message limit.

rtfminc
  • 6,243
  • 7
  • 36
  • 45
  • 3
    The 1000 log message limit is for the buffer, not for the log file itself. When it reaches the max buffer size, it flushes the buffer, meaning it writes it to disk. – Tyler Rick May 24 '12 at 03:38