logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "COHEN, STEVEN M" <sc1...@att.com>
Subject Copying appenders and loggers from a confgiruation to a builder
Date Thu, 17 Nov 2016 15:29:11 GMT
I am trying to construct a program that basically reads a bunch of log4j2 configuration files
and combines them into one, writing this back to disk using the new ConfigurationBuilder.writeXmlConfiguration(OutputStream)
method.  

But I run up against what seems to me to be a gap in the API unless I am missing something:
Having created a ConfigurationBuilder for the destination file and having read one of the
to-be-combined configuration files into a Configuration object, there appears to be nothing
in the ConfigurationBuilder interface that would allow, say, one of the appenders from the
read-in configuration to be copied, as a whole object,into the builder, short of deconstructing
it down to its constituent elements and adding them one by one.

Is there a way to copy an appender from one configuration to another without drilling down
into all its constituent parts?  And similarly, a way to copy a logger from one configuration
to another without drilling down to its constituent parts?  Or must I write all this code
myself?



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message