I might be wrong, but I'll bet Babu wasn't considering
programmatically creating the DailyRollingFileAppender. Babu, I
think what you are looking for is using a system property to define
the file name for the appender. For instance...
log4j.appender.myRollingAppender.File=/logs/${myRollingAppenderFileName}
If your configuration code, make sure you set the system property
"myRollingAppenderFileName" before you call one of the configure()
methods. Or, just add something like
"-DmyRollingAppenderFileName=someFileName.log" to the command line
where you start your java program. In the latter case, you can use
Log4j auto-configuration rather than having to call configure() manually.
Jake
At 09:28 AM 4/30/2006, you wrote:
>You could either use the 3 parameter constructor or call
>DailyRollingFileAppender.setFile (inheritied from FileAppender).
>testMinuteRollover in http://svn.apache.org/repos/asf/logging/log4j/
>trunk/tests/src/java/org/apache/log4j/DRFATestCase.java demonstrates
>using the 3 parameter constructor. If you use the 0 parameter
>constructor and setFile, call activateOptions() before connecting the
>appender to a logger.
>
>
>On Apr 30, 2006, at 5:06 AM, ITN (Babu Easwaramoorthy) wrote:
>
>> Hi,
>>
>> I am using DailyRollingFileAppender.
>> I do not want to specify the file name in the properties file.
>> Instead I
>> want to pass the file name when I instantiate the Logger in my
>> programme.
>> Is there any way to achieve this?
>>
>>
>> Thanks in advance,
>> Babu
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]