How to implement Log File Rotation in Linux Servers
NB: We are using CentOS Servers
- Switch to root user
- cd /etc/logrotate.d/ (by default we will be having this directory in our server)
- create a new file project-logs vi project-logs
- Add the following piece of code to this file
size=10M
missingok
rotate 20
compress
delaycompress
notifempty
copytruncate
daily
}
5. logrotate -f /etc/logrotate.d/
This will create new log files once the log file size reaches 10MB.
missingok
rotate 20
compress
delaycompress
notifempty
copytruncate
daily
}
5. logrotate -f /etc/logrotate.d/
This will create new log files once the log file size reaches 10MB.
NOTE: When you first setup a daily logrotate.d entry, it will not rotate the first day. Next day onwards you can see the changes.
Great information shared about ROR, its really helps in Rails development. Thanks a lot for sharing.
ReplyDeleteHere is a good case study on how evolveum developed elaborate log viewer showing basic performance information, displaying customized lists of relevant lines, selecting lines to be displayed in the outline e. g. to see only relevant threads, (collapsing, expanding) of structured information at the level of log entries https://evolveum.com/blog/problem-analysis-evolveum-log-viewer/ worth reading.
ReplyDeleteThanks for sharing. If you are looking for Ruby on Rails companies in India, then contact Cryptex Technologies. It is one of the most well-known company who works on ROR from last 8 years. So if you wwant to develop any application on ROR or have any queries email us at: info@cryptextechnologies.com
ReplyDelete