This content has been marked as final.
Show 2 replies
-
1. Re: Wildfly 9 how to use rotate-on-boot?
jaysensharma Mar 2, 2016 3:36 AM (in response to hchenkwi)Hello Helen,
One option that i can think of will be to pass the server.log file name dynamically based on the timestamp as following:
1. Edit the standalone.xml (Or your profile file) file and then edit it as following: <file relative-to="jboss.server.log.dir" path="${server.log.dynamic.name}"/>
<periodic-rotating-file-handler name="FILE" autoflush="true"> <formatter> <named-formatter name="PATTERN"/> </formatter> <!-- <file relative-to="jboss.server.log.dir" path="server.log"/> --> <file relative-to="jboss.server.log.dir" path="${server.log.dynamic.name}"/> <!-- NOTICE !!! --> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-rotating-file-handler>
2. Now start the WildFly by passing the dynamic file name:
./standalone.sh -c standalone.xml -Dserver.log.dynamic.name=server_`date +%Y%m%d-%H%M`.log
In your case you can try doing the same thing with your "custom-handler" As following:
<property name="fileName" value="${jboss.server.log.dir}/${server.log.dynamic.name}"/>
Regards
Jay SenSharma
-
2. Re: Wildfly 9 how to use rotate-on-boot?
hchenkwi Mar 2, 2016 11:38 AM (in response to jaysensharma)Hi Jay,
Your solution is actually specifying the log file name at startup script.
Then what does the rotate-on-boot flag mean? I thought it will rotate the log file automatically. Maybe my understanding for this flag is wrong.
Thanks a lot for your help,
Helen