If logs are configured to rollover/rotate daily (pattern '.'yyyy-MM-dd), is it possible to set the time that they rollover? For example, 11:55pm instead of midnight.
See this configuration, you can configure pattern here
http://localhost:4502/system/console/configMgr at Apache Sling Logging Configuration
Article which give more details on implmentation
Please refer to the articles mentioned below :-
The rolling schedule is specified by setting the
org.apache.sling.commons.log.file.size property to a
java.text.SimpleDateFormat pattern. Literal text (such as a leading dot) to be included must be enclosed within a pair of single quotes. A formatted version of the date pattern is used as the suffix for the rolled file name. Internally the Log bundle configures a
TimeBasedRollingPolicy for the appender. Refer to TimeBasedRollingPolicy for more details around the pattern format
For example, if the log file is configured as
/foo/bar.log and the pattern set to
'.'yyyy-MM-dd, on 2001-02-16 at midnight, the logging file
/foo/bar.log will be renamed to
/foo/bar.log.2001-02-16 and logging for 2001-02-17 will continue in a new
/foo/bar.log file until it rolls over the next day.
It is possible to specify monthly, weekly, half-daily, daily, hourly, or minutely rollover schedules.
|Rollover at the beginning of each month||At midnight of May 31st, 2002 |
|Rollover at the first day of each week. The first day of the week depends on the locale.||Assuming the first day of the week is Sunday, on Saturday midnight, June 9th 2002, the file |
|Rollover at midnight each day.||At midnight, on March 8th, 2002, |
|Rollover at midnight and midday of each day.||at noon, on March 9th, 2002, |
|Rollover at the top of every hour.||At approximately 11:00.000 o'clock on March 9th, 2002, |
|Rollover at the beginning of every minute.||At approximately 11:23,000, on March 9th, 2001, |
I hope this would help you.
Thanks and Regards
Sorry, I think I misstated my question. I still want a daily log (one per day), but I want them to rollover not at midnight. I want them to roll at say 11pm. I understand that changing the pattern to something like yyyy-MM-dd-HH would roll them every hour but then I would end up with 24 logs per day.
The reason I ask is that we have a process that sweeps/copies logs to a central server. That process has to run at 11:59pm. It is not picking up the AEM logs for that day because they have not rolled yet.