Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 49342 invoked from network); 27 Jan 2011 17:12:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2011 17:12:24 -0000 Received: (qmail 23691 invoked by uid 500); 27 Jan 2011 17:12:24 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 23559 invoked by uid 500); 27 Jan 2011 17:12:22 -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 23550 invoked by uid 99); 27 Jan 2011 17:12:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 17:12:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.214.47] (HELO mail-bw0-f47.google.com) (209.85.214.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 17:12:14 +0000 Received: by bwz10 with SMTP id 10so2635141bwz.34 for ; Thu, 27 Jan 2011 09:11:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.59.129 with SMTP id l1mr1699491bkh.88.1296148313119; Thu, 27 Jan 2011 09:11:53 -0800 (PST) Sender: rodney2008@rodneybeede.com Received: by 10.204.62.20 with HTTP; Thu, 27 Jan 2011 09:11:53 -0800 (PST) In-Reply-To: References: Date: Thu, 27 Jan 2011 10:11:53 -0700 X-Google-Sender-Auth: 9E2D3VCj7p4qfVan_AJJUh2ji4A Message-ID: Subject: Re: creating log4j log file name at run time From: Rodney Beede To: Log4J Users List Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Simply create a new logger with no appenders and attach a new file appender to that logger. Use that new logger only for the class running the import. On Thu, Jan 27, 2011 at 10:07 AM, Umesh Awasthi wr= ote: > Hi All, > > I am working on an module for import process which can be triggered by > various way by user click by schdular etc. and it will go with the phasse= of > validation and if validation is success than final import. in order to sh= ow > up validation error to the user we want to use the log file so that if > validation failed we will just pick the log file and show that in a windo= w. > So far everything was fine but now i need to create a logfile for each > import job something like when a job start get timestamp and name the log > file based on the time stamp also same time for each job i need to store = the > log file name for that job so that later can pick the same log file for > display purpose. > i gone through various questions on found by googling =A0but seems that t= he > requirement was quite different. One approach which i came to know is to = get > list of all appenders and den override the name of the file in the code b= ut > since we are in web-application i am not sure about the thread safty and = any > other potential issue > Can some one suggest me how i can create a seperate log file for each imp= ort > process instance. > > -- > With Regards > Umesh Awasthi > Software Engineers never die=85 They just go Offline > http://travelling-rants.blogspot.com/ > --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org