I am running this tool called yajsw which generates a log file named as wrapper.log.0. What I notice after sometime it becomes too big and I cannot run the zip command too? Can I run a cron job to daily flush the log file into individual daily log files? Any idea how to do it?
Looking at the documentation it appears that you can configure yajsw to roll it's logs when
wrapper.logfile.maxsize
is reachedor one of the conditions of
wrapper.logfile.rollmode
is metwrapper.logfile.maxfiles
looks interesting and relevant too.In Linux, if you have an open file handle on a file, moving or deleting the file will not affect the file handle. Thus, you cannot easily rotate the file without help from the process that writes to the file (it will simply keep writing to the deleted file). You need to investigate yajsw to see if it supports re-opening the log file. If it does, you can use logrotate, which is usually present on CentOS boxen to rotate the file.