Return-Path: Delivered-To: apmail-jakarta-log4j-user-archive@apache.org Received: (qmail 66432 invoked from network); 11 Dec 2002 13:07:31 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 11 Dec 2002 13:07:31 -0000 Received: (qmail 24580 invoked by uid 97); 11 Dec 2002 13:08:35 -0000 Delivered-To: qmlist-jakarta-archive-log4j-user@jakarta.apache.org Received: (qmail 24560 invoked by uid 97); 11 Dec 2002 13:08:34 -0000 Mailing-List: contact log4j-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@jakarta.apache.org Received: (qmail 24548 invoked by uid 98); 11 Dec 2002 13:08:33 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Change properties at runtime Date: Wed, 11 Dec 2002 08:07:21 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Change properties at runtime Thread-Index: AcKhBs8iIYQXjgOLRFK1/sg0jHfmrAADwuig From: "Shapira, Yoav" To: "Log4J Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, Don't re-configure. Programatically traverse the logger and/or appender tree to set properties you want. Not all properties are reset-able at runtime. =20 For example, to change the logger level at runtime: private static void changeLoggerLevel(String fqcn, String level) { if((fqcn =3D=3D null) || (level =3D=3D null)) return; =20 Logger logger =3D Logger.getLogger(fqcn); logger.setLevel(Level.toLevel(level)); } I omitted exception handling code from the above, and I'm assuming you're using the standard logger name =3D class (or package) name convention. FQCN stands for fully-qualified class name, but is a bit of a mis-nomer as the above will work for a package as well. Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Kohinoor Lal Verma (EHS) [mailto:Kohinoor.Verma@ehs.ericsson.se] >Sent: Wednesday, December 11, 2002 6:14 AM >To: 'Log4J Users List' >Subject: Change properties at runtime > >Hi, > >I have a problem. >I want change some properties of log4j on the fly without affecting rest of >the properties. >I have tried useing PropertyConfigurator.configure(). Calling this method >removes all previously configured properties and only the new properties >are >set. Can anybody help ??? > > >Rgds >Kohinoor > > >----------------------------- > >Kohinoor Lal Verma, >Senior Systems Engineer, >Ericsson Mobile Commerce Platform, >New Delhi, India. > >-- >To unsubscribe, e-mail: unsubscribe@jakarta.apache.org> >For additional commands, e-mail: help@jakarta.apache.org> -- To unsubscribe, e-mail: For additional commands, e-mail: