logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bender Heri" <HBen...@Ergonomics.ch>
Subject RE: different log4J log files for same application
Date Mon, 06 Mar 2006 09:19:38 GMT
This issue was discussed last week extensively. See mail archive.
Heri

> -----Original Message-----
> From: waltz co [mailto:waltz_co@yahoo.com]
> Sent: Monday, March 06, 2006 5:26 AM
> To: log4j-user@logging.apache.org
> Subject: different log4J log files for same application
> 
> 
> hi, 
>   i have an application that listens to a specific port to do 
> its task. 
> this app runs on multiple instances by specifying different ports in 
> the argument. 
>    
>   MyApp-1211.bat contains 
>     java com.sample.MyApp 1211 
>   
>  
>   MyApp-1311.bat contains 
>    java com.sample.MyApp 1311 
>   
>  
>   MyApp-1411.bat contains 
>    java com.sample.MyApp 1411 
> 
>      this application logs to a file. the problem is all 3 instances 
> log into a single file, myApp.log. is there a way to tell 
> log4j to use 
> different log files, like: 
> 
> myApp-port1211.log 
> myApp-port1311.log 
> myApp-port1411.log 
>    
>   can you tell me how do i configure my log4j.properties file 
> to achive this? here's 
> my current configuration file:
>    
> log4j.rootCategory=DEBUG, R
> log4j.logger.com=DEBUG, R
> log4j.logger.com.sample.MyApp=INFO,stdout
> 
> # stdout is console output
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%m%n
> 
> # R is set to a log file that rolls over to a new file after 
> the MaxFileSize size.
> # One backup log file is kept
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.File=../../logs/myApp.log
> log4j.appender.R.MaxFileSize=5000KB
> #Keep one backup file
> log4j.appender.R.MaxBackupIndex=3
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=%d~%p~%c~ %m%n
>    
> thanks.
> 
>         
> 
> 
> 		
> ---------------------------------
> Yahoo! Mail
> Bring photos to life! New PhotoMail  makes sharing a breeze. 
> 

---------------------------------------------------------------------
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