-
1. Re: Log compression on rotation
jamezp Sep 27, 2018 7:18 PM (in response to vokail)You configure it by setting the suffix to either .gz or .zip. For example with the default daily rotating file handler the follow CLI command would compress the file when it's rotated.
/subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name=suffix, value=".yyyy-MM-dd.zip")
--
James R. Perkins
-
2. Re: Log compression on rotation
kramar Feb 15, 2019 4:32 AM (in response to jamezp)I have tried the jboss-cli command with WildFly 15.0.1.Final, but it has been rejected:
[standalone@embedded /] /subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name=suffix, value=".yyyy-MM-dd.zip")
{
"outcome" => "failed",
"failure-description" => "WFLYLOG0041: The suffix (.yyyy-MM-dd.zip) is invalid. A suffix must be a valid date format.",
"rolled-back" => true
}
[standalone@embedded /] /core-service=module-loading:list-resource-loader-paths(module=org.jboss.logmanager)
{
"outcome" => "success",
"result" => [
"wildfly-home/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.5.Final.jar",
"wildfly-home/modules/system/layers/base/org/jboss/logmanager/main/lib"
]
}
What could be the reason?
/Vladimir
-
3. Re: Log compression on rotation
jamezp Feb 15, 2019 11:53 AM (in response to kramar)Well that's embarrassing. It looks like a bug. I've filed https://issues.jboss.org/browse/WFCORE-4331. Not ideal, but as a workaround you could do:
/subsystem=logging/custom-handler=FILE:add(module=org.jboss.logmanager, class="org".jboss.logmanager.handlers.PeriodicRotatingFileHandler, named-formatter=PATTERN, properties={autoFlush=true, append=true, fileName=${jboss.server.log.dir}/server.log, suffix=".yyyy-MM-dd.zip"})
--
James R. Perkins