Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8AD4718BB7 for ; Mon, 25 Jan 2016 12:23:40 +0000 (UTC) Received: (qmail 27631 invoked by uid 500); 25 Jan 2016 12:23:40 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 27559 invoked by uid 500); 25 Jan 2016 12:23:40 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 27384 invoked by uid 99); 25 Jan 2016 12:23:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jan 2016 12:23:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0C63F2C1F70 for ; Mon, 25 Jan 2016 12:23:40 +0000 (UTC) Date: Mon, 25 Jan 2016 12:23:40 +0000 (UTC) From: "Philipp Knobel (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-494) Support composite configurations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15115119#comment-15115119 ] Philipp Knobel commented on LOG4J2-494: --------------------------------------- I think before it actually makes sense to start working on this issue, the basic scope/path to go needs to be defined. Right now I basically see two possible approaches available: 1. Composite configurations, on startup you simply specifiy multiple configurations, which are merged into one. The later configuration wins over stuff defined in previous configurations. With this, you basically could override anything with your app specific configs. 2. Extend xinclude, currently xinclude seems to be capable of only including the full file and there's no proper notion of optional. It seems that extending xinclude to properly support xpointers could solve the required functionality already. This would allow to have multiple configurations, where each config file would be a valid log4j2 configuration. The xinclude would then just pull in parts of the file (like appenders), the resulting configuration (in memory) would be basically the same as with option 1. To me it looks like, we're close to what is needed for composite log configuration, with the help of xinclude. But I lack the knowledge to say if this would be the way to go and this would be limited to xml based configuration only. On the other side, option 1 actually seems to be more general being applicable to all kinds of configurations as this would work on the java structure rather than some specific configuration file. One probably could even mix multiple file formats. Log4j2 could automatically use this approach if it detects multiple configurations. So it seems that option 1 should be the preferred way. > Support composite configurations > -------------------------------- > > Key: LOG4J2-494 > URL: https://issues.apache.org/jira/browse/LOG4J2-494 > Project: Log4j 2 > Issue Type: New Feature > Components: Configurators > Affects Versions: 2.0-beta9 > Reporter: Ralph Goers > Assignee: Ralph Goers > > Support was added to XMLConfiguration to allow XIncludes in the XML files. While this can be useful it does not allow for the use case where someone wants a default configuration and then a custom configuration to be merged with it. > I am proposing creating a CompositeConfiguration class that accepts a comma separated list of configuration files. It would then use the Configuration factories to create the appropriate Configuration classes for each of the underlying files. It would then merge the Node hierarchies created by each into a single tree and then finally construct the actual configuration Objects from that tree. > There are a few issues with this - for example each configuration can specify debug and verbose attributes, duplicate property settings, handling duplicate Appender names, etc. Most of these should be fairly easy to resolve. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org