Return-Path: Delivered-To: apmail-logging-general-archive@www.apache.org Received: (qmail 83163 invoked from network); 29 Jun 2006 16:19:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2006 16:19:19 -0000 Received: (qmail 35469 invoked by uid 500); 29 Jun 2006 16:19:18 -0000 Delivered-To: apmail-logging-general-archive@logging.apache.org Received: (qmail 35421 invoked by uid 500); 29 Jun 2006 16:19:17 -0000 Mailing-List: contact general-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Logging General" List-Id: Delivered-To: mailing list general@logging.apache.org Received: (qmail 35409 invoked by uid 99); 29 Jun 2006 16:19:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 09:19:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [193.111.42.111] (HELO ponyexpress.finibanco.pt) (193.111.42.111) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 09:19:15 -0700 Received: from davila3.finibanco.pt (davila3.finibanco.pt [10.205.240.45]) by ponyexpress.finibanco.pt (8.13.4/8.12.8) with ESMTP id k5TGIq4P007294 for ; Thu, 29 Jun 2006 17:18:52 +0100 Sensitivity: Subject: multiple files To: general@logging.apache.org From: "Daniel Carvalho" Date: Thu, 29 Jun 2006 17:03:53 +0100 Message-ID: X-MIMETrack: Serialize by Router on davila3/FNB(Release 5.0.13a |April 8, 2004) at 29-06-2006 17:18:55 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi. i would like to have log4j configured so that each logger is appended t= o a different file. The filename would be based on logger's name, with dots replaced by fil= e-separator. For instance, the logger named "aplic.dada.x1" would go to= "/MYLOGDIR/aplic/dada/x1.log" It would be nice to have an appender "FileTreeAppender" with this funci= onality. Then i would configure the root logger to use this appender. Acorddingly to log4j rules, all other loggers would inherit this append= er. But this wouldn't work, because all loggers would use the same instance= of FileTreeAppender, but i want their outputs to go to different files= . One solution would be the "FileTreeAppender.doAppend" method choose the fil= e based in LoggingEvent.getLoggerName(), but this would be very slow. So i think i will have to dinamically create an FileAppender for each L= ogger. I would like to ask if there is a way to automatically do this, = each time someone calls Logger.getLogger. I saw that one solution was to define LoggerFactory. But the API says: = "The usage of custom logger factories is discouraged and no longer docu= mented." can someone point to better solutions? thanks daniel __________________________________________________ Esta mensagem e quaisquer ficheiros anexos s=E3o confidenciais, destina= ndo-se ao uso exclusivo da pessoa e/ou entidade a que se dirigem. Caso n=E3o s= e lhe destine, ou n=E3o seja respons=E1vel pelo seu encaminhamento ao destina= t=E1rio, informamos que a recebeu por engano. Qualquer utiliza=E7=E3o, distribui= =E7=E3o, reencaminhamento ou outra forma de revela=E7=E3o a terceiros, impress=E3= o ou c=F3pia s=E3o expressamente proibidos; sendo que agradecemos que destru= a a mensagem de imediato, informando o seu emissor ou o Finibanco do sucedi= do. N=E3o obstante o Finibanco utilizar software anti-v=EDrus como precau=E7= =E3o, n=E3o =E9 poss=EDvel garantir que a presente mensagem e eventuais ficheiros anexo= s n=E3o cont=EAm v=EDrus, pelo que n=E3o consideramos da responsabilidade desta= institui=E7=E3o eventuais consequ=EAncias inerentes. Alerta-se, ainda, = que as mensagens transmitidas por este meio podem ser interceptadas, corrompid= as, perdidas, destru=EDdas ou entregues com atraso ao destinat=E1rio. =