RE: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread COHEN, STEVEN M
https://issues.apache.org/jira/browse/LOG4J2-1713 Thanks Gary -Original Message- From: Gary Gregory [mailto:garydgreg...@gmail.com] Sent: Thursday, November 17, 2016 12:49 PM To: Log4J Users List Subject: Re: Copying appenders and loggers from a

RE: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread COHEN, STEVEN M
Duh! How did I miss that? -Original Message- From: Gary Gregory [mailto:garydgreg...@gmail.com] Sent: Thursday, November 17, 2016 12:49 PM To: Log4J Users List Subject: Re: Copying appenders and loggers from a confgiruation to a builder You need to click

Re: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread Gary Gregory
You need to click the red text in the "Create" button, not the drop down arrow. >From a high level you want to do something like this: c1 = load config from XML file 1 (but do not apply the c1 configuration) c2 = load config from XML file 2 (but do not apply the c2 configuration) c3 = c1 + c2

RE: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread COHEN, STEVEN M
I don't think I'm able to do so. Although I set up an account on the JIRA and have logged in, the only thing I'm allowed to "Create" is a "Service Desk Request". There is nothing there about reporting a bug, requesting a feature, etc. CompositeConfiguration does not help either. My use case

RE: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread COHEN, STEVEN M
Looking at the MergeStrategy source code, it seems a bit confusing. The method mergeRootProperties() seems to apply not to elements but to root element attributes such as "monitorInterval", "status", etc. The method might be better named mergeRootAttributes. I think, I will have to adhere

Re: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread Mikael Ståldal
ConfigurationBuilder.writeXmlConfiguration(OutputStream) only works if you have an ConfigurationBuilder that is populated somehow, you cannot use it on an arbitrary Configuration object. I tried to support that, but it turned out to be to difficult. The built-in parsers for XML, JSON and YAML

Re: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread Gary Gregory
Please feel free to record your feature request in JIRA: https://issues.apache.org/jira/browse/LOG4J2 Gary On Thu, Nov 17, 2016 at 7:47 AM, COHEN, STEVEN M wrote: > Thanks, that almost works for me, and will have to do, I suppose. The > problem is that I was hoping to be able

RE: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread COHEN, STEVEN M
Thanks, that almost works for me, and will have to do, I suppose. The problem is that I was hoping to be able to load each subconfig in first, filtering in any property definitions, which would then lead to writable output that would not contain properties, but their expanded values. It would

Re: Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread Matt Sicker
I don't believe there is an API in ConfigurationBuilder that uses actual plugin objects. That would certainly be a new feature. However, you did mention combining configuration files which is already implemented through composite configuration:

Copying appenders and loggers from a confgiruation to a builder

2016-11-17 Thread COHEN, STEVEN M
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