You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Reza Razavipour <re...@gmail.com> on 2008/09/16 16:17:11 UTC

DatePattern question

All,

how do I set and get DatePattern attribute from a
DailyRollingFileAppender, in code?

Thanks
Reza

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: DatePattern question

Posted by Michael Erskine <mi...@ketech.com>.
> Thanks for the hint, my version of log4j does not have such support, I
> did RTFM :)
> Which version of log4j has these methods? I will check again though.

I'm using the latest 1.2 log4j (http://logging.apache.org/log4j/1.2/index.html) which is 1.2.15 (http://archive.apache.org/dist/logging/log4j/1.2.15/). The DailyRollingFileAppender methods getDatePattern and setDatePattern are documented at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html#getDatePattern() and http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html#setDatePattern(java.lang.String)
respectively.

Enjoy,
Michael Erskine.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: DatePattern question

Posted by Reza Razavipour <re...@gmail.com>.
Thanks for the hint, my version of log4j does not have such support, I
did RTFM :)

Which version of log4j has these methods? I will check again though.

Thanks
Reza

On Wed, Sep 17, 2008 at 12:35 AM, Michael Erskine
<mi...@ketech.com> wrote:
>> how do I set and get DatePattern attribute from a
>> DailyRollingFileAppender, in code?
>
> Hi Reza,
>
> I don't want to sound "all RTFM" :) but the DailyRollingFileAppender has methods getDatePattern and setDatePattern! Perhaps a glance at the code? :)
>
> Regards,
> Michael Erskine.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: DatePattern question

Posted by Michael Erskine <mi...@ketech.com>.
> how do I set and get DatePattern attribute from a
> DailyRollingFileAppender, in code?

Hi Reza,

I don't want to sound "all RTFM" :) but the DailyRollingFileAppender has methods getDatePattern and setDatePattern! Perhaps a glance at the code? :)

Regards,
Michael Erskine.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: DatePattern question

Posted by Reza Razavipour <re...@gmail.com>.
I understand this, thanks. The question was how to do that at runtime,
on the fly...

On Tue, Sep 16, 2008 at 11:02 PM, NehaG <ne...@wipro.com> wrote:
>
> The DatePattern Attribute can be set from the configuration file of log4j as
> follows:
>
> log4j.appender.appendername.DatePattern='.'dd-MMM-yyyy'.log'
>
>
>
> Reza Razavipour-2 wrote:
>>
>> All,
>>
>> how do I set and get DatePattern attribute from a
>> DailyRollingFileAppender, in code?
>>
>> Thanks
>> Reza
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/DatePattern-question-tp19512835p19525870.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: DatePattern question

Posted by NehaG <ne...@wipro.com>.
The DatePattern Attribute can be set from the configuration file of log4j as
follows:

log4j.appender.appendername.DatePattern='.'dd-MMM-yyyy'.log'



Reza Razavipour-2 wrote:
> 
> All,
> 
> how do I set and get DatePattern attribute from a
> DailyRollingFileAppender, in code?
> 
> Thanks
> Reza
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/DatePattern-question-tp19512835p19525870.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org