[jboss-jira] [JBoss JIRA] (LOGMGR-139) Add maxBackupIndex to periodic-rotating-file-handlers
Rémy Garrigue (JIRA)
issues at jboss.org
Thu Jun 16 16:00:01 EDT 2016
[ https://issues.jboss.org/browse/LOGMGR-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253756#comment-13253756 ]
Rémy Garrigue commented on LOGMGR-139:
--------------------------------------
Sorry for the lack of accuracy : I'm working on Wildfly, from v7 onward.
I don't see the difficulty about the rotating & removing. Linux's logrotated is doing that fine : take files matching name+date format, order them by time, remove index > maxBackupIndex. Truth is I dunno what logrotate would do if I drop a file with a name matching the pattern, but I guess that would be my bad.
I tried OS tool, namely logrotate. Problem is, Wildfly keeps its file descriptor open, hence keep writing on renamed log. For example if server.log got renamed server.log.20161606 and a new server.log is created by logrotated, new log still go in server.log.20161606. The best I could think about is adding a postrotate bloc which will call jboss-cli to change-file unto server.log. That works.
For the custom handler, I tried something like this (not at work atm, can't c/c the one I tried). It simply didn't worked, after 2 days I ended up with 3 log files (current, day+1 day+2) when my max backup is 1
{code:java}
<size-rotating-file-handler name="FILE">
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<rotate-size value="1000000000"/>
<max-backup-index value="1"/>
<append value="true"/>
</size-rotating-file-handler>
{code}
> Add maxBackupIndex to periodic-rotating-file-handlers
> -----------------------------------------------------
>
> Key: LOGMGR-139
> URL: https://issues.jboss.org/browse/LOGMGR-139
> Project: JBoss Log Manager
> Issue Type: Enhancement
> Reporter: Rémy Garrigue
> Priority: Minor
>
> That's all in the title.
> We would like to have a daily log, keeping 15 days of log. Actually there's no way to do that except maybe custom handler which we can't get to work. That'ld be far easier if there was the same maxBackupIndex option as in size rotating handler.
> Regards,
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list