Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 95294 invoked from network); 20 Jan 2009 01:06:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jan 2009 01:06:17 -0000 Received: (qmail 96905 invoked by uid 500); 20 Jan 2009 01:06:11 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 96884 invoked by uid 500); 20 Jan 2009 01:06:11 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 96873 invoked by uid 99); 20 Jan 2009 01:06:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2009 17:06:11 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of arindam.bosco05@gmail.com designates 209.85.142.185 as permitted sender) Received: from [209.85.142.185] (HELO ti-out-0910.google.com) (209.85.142.185) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jan 2009 01:06:04 +0000 Received: by ti-out-0910.google.com with SMTP id a21so2165745tia.4 for ; Mon, 19 Jan 2009 17:05:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=yl5PDL5rIHmQW+46AOZbH22SjCE3Q3mTNUS2f4P2yik=; b=dx9IELBZkLnC8U9YFGyPdcvUBUZs5ll9Aj2GMzn53o92A7hEE/Osm+rwhyrWzRbDKH zjrXQpESbphA+hxp9OHj86EC0OO9z7jy7RRkTQI6immXQbFWkmLsj99sOGOwQtMPgCh3 PRFrqjWuJw51yuzcm4l0K13UcVtOnnZa1AJbU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Q+82o/217fgi/uK0yFpvI1VFQY7flD/HhA8UzyOamCwc6hjqhA04pqbA1MbidRCGou 3eg/TtYVAqWbcaytR6kYy3oeIlc5Z7oxOTyEG2IgIepCO7eN+sa6X1utF4jzaLJbh0ym h6t7jSa2mnZ49CaEyISeiQrJoleHE/kFibtFM= MIME-Version: 1.0 Received: by 10.110.3.15 with SMTP id 15mr9031954tic.44.1232413542878; Mon, 19 Jan 2009 17:05:42 -0800 (PST) In-Reply-To: References: Date: Tue, 20 Jan 2009 06:35:42 +0530 Message-ID: Subject: Re: log4j and xlink From: Arindam To: Log4J Users List Content-Type: multipart/alternative; boundary=001485f4225e708f190460dfa308 X-Virus-Checked: Checked by ClamAV on apache.org --001485f4225e708f190460dfa308 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Mon, Jan 19, 2009 at 11:52 PM, Curt Arnold wrote: > > On Jan 18, 2009, at 10:41 PM, Arindam wrote: > > Hi, I am faced with a problem. I have multiple java-modules which run as >> daemons, and am configuring their log4j.xml configuration. >> I would like the individual xml configuration files to pick up the stdout >> / >> email appenders from a core file, and have their own appenders along with >> them. >> I was thinking of using Xlink to do such a linking, but it seems Xlink is >> not supported in log4j. >> >> Is there a way to link appenders defined in another xml ? Except maybe >> programmatically attach an appender ? >> >> Thanks, >> Arindam. >> >> > > You can use external entities which the XML parser will resolve before > log4j see anything. For example: > > > ]> > > > &common; > > > > > I believe earlier versions of log4j had problems with external entities > (either they didn't work at all or you had to use absolute URL since the > base URL was lost). > Thanks Curt, it works like a charm, the only caveat being I have to put the external entity up as a HTTP URL publicly accessible. Otherwise java.net.MalformedURLException: unknown protocol: dummy is thrown for a local file. Basically the internal xerces handler has code only to deal with http protocols, and not anything else. I tried using file://common.xml , but strangely that tries to do a ftp access ... This will satisfy my needs, but I would really like it to work without running a webserver instance. Any ideas on it ? Thanks, Arindam. --001485f4225e708f190460dfa308--