Anand Kadhi
Anand Kadhi

Reputation: 1878

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.

Upvotes: 5

Views: 7327

Answers (2)

Caffeine Coder
Caffeine Coder

Reputation: 1196

You need to update standalone.initial.xml in standalone_xml_history directory. Then restart Jboss, your changes would take place.

reference- https://docs.jboss.org/author/display/AS7/Configuration%20file%20history.html

Upvotes: 0

janinee
janinee

Reputation: 133

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.

Upvotes: 3

Related Questions