How refresh log on daily basis?

Looking at the documentation it appears that you can configure yajsw to roll it's logs when

wrapper.logfile.maxsize is reached

The wrapper.log file can be set to roll when the file reaches a specified size. The default value of 0 will disable log file rolling. To roll the file, specify a maximum file size in bytes. The size can be abbreviated with the suffixes 'k' for kilobytes, or 'm' for megabytes. For example, '10m' sets the log file to be rolled when it reaches a size of 10 megabytes.

or one of the conditions of

wrapper.logfile.rollmode is met

Controls the roll mode of the log file. Possible values include:

JVM - The log file will be rolled on Wrapper startup as with the WRAPPER mode. But it will also be rolled just before any restarted JVMs are launced. The log files will not have a maximum size and will continue to grow until the Wrapper or a JVM is restarted.

DATE - As each log entry is logged to a file, its timestamp is compared with a YYYYMMDD formatted token in the current log file. Whenever this date changes a new log file will be opened. This has the benefit of grouping all log entries for a given day in a specific file. A file will not be created on days which do not have any log output.

wrapper.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.