When the configuration is made from source code, I need a way to see what was configured without debugging the Java code. I would like to see the current configuration as an XML (similar to log4j2.xml file).
<?xml version="1.0" ?>
<Configuration>
<Appenders>
<RollingFile name ....
</Configuration>
I am able to see the XML string when working with ConfigurationBuilder.writeXmlConfiguration/toXmlConfiguration methods. From what I understand this is only available only when using the builder.
From time to time I change different values in the configuration using code like this:
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Configuration config = ctx.getConfiguration();
...
Is there something like: config.toXML()?
I am thinking to do a small class that we can use to achieve this feature, but first, I want to make sure there is no other possibility.