logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Beede <mailingl...@rodneybeede.com>
Subject Re: creating log4j log file name at run time
Date Thu, 27 Jan 2011 17:11:53 GMT
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 <umeshawasthi@gmail.com> wrote:
> 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 show
> 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 window.
> 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  but seems that the
> 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 but
> 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 import
> process instance.
>
> --
> With Regards
> Umesh Awasthi
> Software Engineers never die… 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


Mime
View raw message