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 Kailash KN <ka...@thbs.com> on 2006/05/23 08:21:17 UTC

Changing log filepath and file name at runtime???

Hi all,

    I would want to change the log filepath and log filename at runtime, how do i go about doing it???

The property file looks like this-
log4j.debug=false

#To specify any user defined logger's level and appender
log4j.logger.DEBUG=debug, debugAppndr

#To specify not append the log statement to upper logger
log4j.additivity.DEBUG=false

#To specify whether to append the new log statement or to start from begining
log4j.appender.debugAppndr.Append=true

#To specify type of appender
log4j.appender.debugAppndr=org.apache.log4j.RollingFileAppender

#To specify name of the appender file
log4j.appender.debugAppndr.File=logs/nre_debug.log

#To specify layout for the appender
log4j.appender.debugAppndr.layout=org.apache.log4j.PatternLayout

#To specify the the way the output looks
log4j.appender.debugAppndr.layout.ConversionPattern=%d{dd:MM:yyyy HH:mm:ss} - %m %n

Thanks & Regards,
Kailash.K.N.

Re: Changing log filepath and file name at runtime???

Posted by Jacob Kjome <ho...@visi.com>.
Use a web-based Log4j config editing tool such as LogWeb...

http://www.codeczar.com/products/logweb/index.html


Jake

On Fri, 3 Aug 2007 13:32:08 -0700 (PDT)
  sateesh <sk...@yahoo.com> wrote:
> 
> Hi James,
> 
> We are running more than one sinatnce of our Service in a separate thread
> and we would like to have separate log file for each of them which we will
> specify while initializing it
> 
> How do we specify it?? 
> 
> We are using SLF4J and Log4J
> 
> Could u pls let me know..
> 
> Thanks
> Kumar
> 
> 
> James Stauffer wrote:
>> 
>> Can you give more details about how and why you want to change it?  Do
>> you want to set it only once per run (then use system properties) or
>> do you want to change it multiple times per run (you may have to write
>> your own appender).
>> 
>> On 5/23/06, Kailash KN <ka...@thbs.com> wrote:
>>> Hi all,
>>>
>>>     I would want to change the log filepath and log filename at runtime,
>>> how do i go about doing it???
>> 
>> 
>> -- 
>> James Stauffer
>> Are you good? Take the test at http://www.livingwaters.com/good/
>> 
>> ---------------------------------------------------------------------
>> 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/Changing-log-filepath-and-file-name-at-runtime----tf1667116.html#a11989397
> 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: Changing log filepath and file name at runtime???

Posted by James Stauffer <st...@gmail.com>.
You many need to use repository selectors so that each instance has
its own configureation.  Then each instance can have its own config
file.

On 8/3/07, sateesh <sk...@yahoo.com> wrote:
>
> Hi James,
>
>  We are running more than one sinatnce of our Service in a separate thread
> and we would like to have separate log file for each of them which we will
> specify while initializing it
>
>  How do we specify it??
>
>  We are using SLF4J and Log4J
>
>  Could u pls let me know..
>
> Thanks
> Kumar
>
>
> James Stauffer wrote:
> >
> > Can you give more details about how and why you want to change it?  Do
> > you want to set it only once per run (then use system properties) or
> > do you want to change it multiple times per run (you may have to write
> > your own appender).
> >
> > On 5/23/06, Kailash KN <ka...@thbs.com> wrote:
> >> Hi all,
> >>
> >>     I would want to change the log filepath and log filename at runtime,
> >> how do i go about doing it???
> >
> >
> > --
> > James Stauffer
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > 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/Changing-log-filepath-and-file-name-at-runtime----tf1667116.html#a11989397
> 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
>
>


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

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


Re: Changing log filepath and file name at runtime???

Posted by sateesh <sk...@yahoo.com>.
Hi James,

 We are running more than one sinatnce of our Service in a separate thread
and we would like to have separate log file for each of them which we will
specify while initializing it

 How do we specify it?? 

 We are using SLF4J and Log4J

 Could u pls let me know..

Thanks
Kumar


James Stauffer wrote:
> 
> Can you give more details about how and why you want to change it?  Do
> you want to set it only once per run (then use system properties) or
> do you want to change it multiple times per run (you may have to write
> your own appender).
> 
> On 5/23/06, Kailash KN <ka...@thbs.com> wrote:
>> Hi all,
>>
>>     I would want to change the log filepath and log filename at runtime,
>> how do i go about doing it???
> 
> 
> -- 
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
> 
> ---------------------------------------------------------------------
> 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/Changing-log-filepath-and-file-name-at-runtime----tf1667116.html#a11989397
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


Re: Changing log filepath and file name at runtime???

Posted by James Stauffer <st...@gmail.com>.
Can you give more details about how and why you want to change it?  Do
you want to set it only once per run (then use system properties) or
do you want to change it multiple times per run (you may have to write
your own appender).

On 5/23/06, Kailash KN <ka...@thbs.com> wrote:
> Hi all,
>
>     I would want to change the log filepath and log filename at runtime, how do i go about doing it???


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

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