user1872384
user1872384

Reputation: 7127

Daily rolling log file in Websphere Liberty (16.0.0.4-WS-LIBERTY-CORE)

How to create a daily rolling log file in Websphere Liberty? I want the name of the log file to have YYYYMMDD format.

Currently I'm only able to limit the max file size, max file and a static naming of messages.log and disable consolelog.

 <logging consoleLogLevel="OFF" maxFileSize="1" maxFiles="3" messageFileName="loggingMessages.log"/>

https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/rwlp_logging.html

Upvotes: 0

Views: 1211

Answers (2)

Andy McCright
Andy McCright

Reputation: 1283

WebSphere Liberty does not currently have the ability to schedule log file rotation like traditional WAS. You can request this feature using the RFE site.

Alternatively, you could use an approach like Bruce mentioned - perhaps using a cron job to restart the server at midnight.

You might also consider configuring Liberty's binary logging. This will create a binary log file that can be queried to produce actual log files (with filtering options, etc.). It does have some time-based options. More info here.

Hope this helps, Andy

Upvotes: 1

Bruce T.
Bruce T.

Reputation: 1002

Probably not the answer you want, but if you restart the server it will roll the log.

Upvotes: 1

Related Questions