Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Parition of log files

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 320
    Comment on it

    Generally we got errors at the time of development so logs are the best place to find out the errors. Its easy to deal with log file on our local machine but if there is a live site and we have to check out for logs and logs are getting larger so sometimes it is unmanageable to reach out to the exact error. So its better to partition the log file on the server and for this there is a option for multiple log files created for smaller sizes so that we can open the file easily and reach out to the error. So for the partition of log file we have to make some settings to the environment file.That is as below:

    config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 10, 5.megabytes)
    

    where first parameter is the name of the file that will be created on the log folder second parameter is the number of maximum log files to be created and once this number is reached it will delete the oldest log file Third parameter is the size of the each log file can have.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: