Yes.  I made an Appender that changes the filename based on the time.
You could change it based on anything in the LoggingEvent.
http://stauffer.james.googlepages.com/DateFormatFileAppender.java

On 8/11/06, Levy, Jeremy <[EMAIL PROTECTED]> wrote:
In my application, we have the consumer pass in the name of the application 
that is using our service.

So we generally only have about 4,5 consumers.  This is small enough that we 
can manually add them to the properties file.  However, as our utility grows I 
don't want to have to maintain or add appenders to the properties file.

Is it possible to dynamically change the file name of a log file based on a 
value?

So if someone calls a web service, if I call getLogger or maybe MDC/NDC is 
there a way to change the name of the log file based a value passed in at 
runtime?

Jeremy

-----Original Message-----
From: Javier Gonzalez [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 10, 2006 1:23 AM
To: Log4J Users List
Subject: Re: Different client's log file?

On 8/10/06, wolverine my <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I'm actually developing a web application using servlet and so I can
> use the client's IP address instead of the client.getName()...

Ah, a web application... no way to know beforehand every single client's id.

mmm, I don't think you can have a log file per client, but maybe you can still 
include the ip address in the logger name. That way, you can grep over the logs 
with the ip address of a given client to study just that client's activity.

--
Javier González Nicolini

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------

Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the 
purchase or sale of any security or commodity, to send fund transfer 
instructions, or to effect any other transactions. Any such request, orders, or 
instructions that you send will not be accepted and will not be processed by 
Morgan Stanley.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to