[jboss-jira] [JBoss JIRA] (WFCORE-4104) Clear log

James Perkins (JIRA) issues at jboss.org
Tue Sep 11 09:03:00 EDT 2018


    [ https://issues.jboss.org/browse/WFCORE-4104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13631752#comment-13631752 ] 

James Perkins commented on WFCORE-4104:
---------------------------------------

You could do this now like you suggest with changing the file name, then changing it back.

{code}
/subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name=file, value={relative-to=jboss.server.log.dir, path="server-new.log"})
/subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name=file, value={relative-to=jboss.server.log.dir, path="serve.log"})
{code}

You'll end up with two files so not ideal, but it will work.

One thing to consider too though is if there was a forced rotation the file rotated by the operation would get overridden and the logs lost on the next rotate.

> Clear log
> ---------
>
>                 Key: WFCORE-4104
>                 URL: https://issues.jboss.org/browse/WFCORE-4104
>             Project: WildFly Core
>          Issue Type: Feature Request
>          Components: Logging
>            Reporter: Olivier Cailloux
>            Assignee: James Perkins
>            Priority: Minor
>
> When debugging it’s handy to be able to easily clear the log just before triggering an action that makes an application misbehave (so that you can then inspect the log knowing that it starts when the action starts).
> For this, it would be nice to have the possibility to force rotate the log on the periodic-rotating-file-handler type of handler.
> Thus we would run something like this in the CLI: /subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name="rotate", value=true)
> Maybe it’s already possible by writing the "enabled" or "change-file" or "append" attribute (twice, to put it back to its previous state), but it feels hackish and it’s undocumented, therefore I’m not sure what the side effects of this would be (even assuming it would work).
> GlassFish for example has [asadmin rotate-log|https://github.com/oliviercailloux/java-course/blob/master/GlassFish.adoc#clear-log].



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jboss-jira mailing list