-
1. Re: Wildfly 10, Log rotation every 10 minutes
jamezp Dec 5, 2017 1:26 PM (in response to proque_cu)You'd have to write a custom-handler if you want it to rotate every 10 minutes. The periodic-rotating-file-handler will only rotate on a given segment. For example you can rotate every hour or every minute, but not every 10 minutes.
--
James R. Perkins
-
2. Re: Wildfly 10, Log rotation every 10 minutes
proque_cu Dec 5, 2017 1:30 PM (in response to jamezp)Hi James,
That is what we are trying to achieve. We are able to do the 1 minute one but unsure of how to make it work for 10.
Thx,
-
3. Re: Wildfly 10, Log rotation every 10 minutes
jamezp Dec 5, 2017 1:48 PM (in response to proque_cu)The only way would be to write a custom handler.
--
James R. Perkins
-
4. Re: Wildfly 10, Log rotation every 10 minutes
brettking Dec 7, 2017 10:19 PM (in response to jamezp)Hi James,
I have the exact same problem described here. Have a need to rotate the log every 15 minutes on Wildfly 10.1.0 Final, and I've been trying to figure it out. And we automate the deployments so looking to have it defined within standalone.xml if possible.
Like above, found a way to log every hour by adding '_HH' to the suffix value, and every minute using '_HH-mm' to the suffix value to a periodic handler, like so:
<periodic-rotating-file-handler name="FILE" autoflush="true">
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="wildfly_server.log"/>
<suffix value=".yyyy-MM-dd_HH-mm"/>
<append value="true"/>
</periodic-rotating-file-handler>
I've never used a custom handler before, however it seems like it takes in certain attributes, such as the ones listed here:
https://wildscribe.github.io/WildFly/10.1/subsystem/logging/custom-handler/index.html
Below is how I'd envision a custom-handler, using other handlers as a guideline. Also wanted to add in periodic-size type of parameters to remove older logs.
Can you advise on what needs to be adjusted to have it rotate in 15 minute intervals? Or am I off the mark and it's controlled somewhere else?
<custom-handler name="FILE" autoflush="true">
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="wildfly_server.log"/>
<suffix value=".yyyy-MM-dd_HH-mm"/>
<append value="true"/>
<maxBackupIndex value="40"/>
<rotateSize value="500m"/>
</custom-handler>
-
5. Re: Wildfly 10, Log rotation every 10 minutes
jamezp Dec 11, 2017 11:53 AM (in response to brettking)Hi Brett,
You'd have to actually write a custom handler. Currently the jboss-logmanager does not have a handler that will allow a file to be rotated at a specified time.
--
James R. Perkins