Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JBoss standalone.xml file changes are being overridden

We am using JBoss 7 in our project and have written the logging configuration in standalone.xml file like this,

 <subsystem xmlns="urn:jboss:domain:logging:1.0">
        .
        .
        .
        <logger category="com.xyz.abc.aspect">
            <level name="DEBUG"/> 
            <handlers>
                <handler name="FILE"/>
            </handlers>
        </logger>
        .
        .
    </subsystem>

Now a situation has arose that i wanted to change the logging configuration by adding use-parent-handlers="false" to avoid the log being redirected to parent handler , now when i add this to standalone.xml

 <logger category="com.xyz.abc.aspect" use-parent-handlers="false">
                <level name="DEBUG"/> 
                <handlers>
                    <handler name="FILE"/>
                </handlers>
            </logger>

and restart the server the logging configuration is reverted back by JBoss to the previous state i.e

<logger category="com.xyz.abc.aspect">
                <level name="DEBUG"/> 
                <handlers>
                    <handler name="FILE"/>
                </handlers>
            </logger>

I have tried deleting standalone_xml_history directory and files under it , but nothing is preventing the overwriting behaviour, can any one please suggest.

like image 989
Anand Kadhi Avatar asked Oct 18 '22 16:10

Anand Kadhi


1 Answers

I'm not 100% sure, but restarting the server probably causes a write-back action of the config. That means your config gets overwritten by with the "current" config the server knows which is the version before you edited the file. You could simply use the management console

confguration > core > logging
or use the CLI
/subsystem=logging/logger=change.me.please:write-attribute(name="use-parent-handlers", value="false")
to make those changes.

Alternatively change the config file when the server is stopped.

like image 172
janinee Avatar answered Nov 02 '22 06:11

janinee