How To Practise Size-Rotating-File Handler Inwards Jboss 7.2 Using Cli

There are times when nosotros require a size-rotating-file handler over the default periodic-rotating-file handler. Simply changing the properties inward standalone.xml won't create because it volition movement synch occupation amongst logging.properties. So to create together with then nosotros need to execute a serial of JBoss cli commands.

First yous need to run: jboss_home/standalone/bin/jboss-cli.sh together with connect.


//remove the default file handler /subsystem=logging/periodic-rotating-file-handler=FILE:remove   //create the novel file handler /subsystem=logging/size-rotating-file-handler=FILE:add(file={"path"=>"server.log", "relative-to"=>"jboss.server.log.dir"}) /subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="autoflush", value="true") /subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="level", value="WARN") /subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="append", value="true") /subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="max-backup-index", value="10") /subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="rotate-size", value="5000k")  

References:
https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Administration_and_Configuration_Guide/Configure_a_Periodic_Log_Handler_in_the_CLI1.html
https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Administration_and_Configuration_Guide/Sample_XML_Configuration_for_a_Size_Log_Handler.html
Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.