jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SGE0 <stefangee...@hotmail.com>
Subject Re: JMeter and Ant Logging
Date Wed, 15 Jul 2009 16:34:38 GMT

Hi,

I agree, I messed up a little bit but it was already late that evening 


So I'll do it all again:

I start ant/meter with following script:
------------------------------------

set ANT_OPTS=-Dlog4j.debug -Dlog4j.configuration=log4j.properties
ant -listener org.apache.tools.ant.listener.Log4jListener -buildfile
monitor.xml

The content of the log4j.properties file is:
----------------------------------------


  log4j.rootCategory=WARN,application,stdout

  #out to file
  log4j.appender.stdout= org.apache.log4j.FileAppender
  log4j.appender.stdout.file = c:/brol7/application2.log
  log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.conversionPattern = %d [%t] %-5p %c - %m%n
  log4j.appender.stdout.append = false
 
  #out to file
  log4j.appender.application = org.apache.log4j.FileAppender
  log4j.appender.application.file = c:/brol7/application.log
  log4j.appender.application.layout = org.apache.log4j.PatternLayout
  log4j.appender.application.layout.conversionPattern = %d [%t] %-5p %c -
%m%n
  log4j.appender.application.append = false

When the .cmd file is started the output is:
------------------------------------------

C:\brol7>set ANT_OPTS=-Dlog4j.debug -Dlog4j.configuration=log4j.properties

C:\brol7>ant -listener org.apache.tools.ant.listener.Log4jListener
-buildfile mo
nitor.xml
Buildfile: monitor.xml
log4j: Trying to find [log4j.properties] using context classloader
java.net.URLClassLoader@de6ced.
log4j: Using URL [file:/C:/brol7/log4j.properties] for automatic log4j
configuration.
log4j: Reading configuration from URL file:/C:/brol7/log4j.properties
log4j: Parsing for [root] with value=[WARN,application,stdout].
log4j: Level token is [WARN].
log4j: Category root set to WARN
log4j: Parsing appender named "application".
log4j: Parsing layout options for "application".
log4j: Setting property [conversionPattern] to [%d [%t] %-5p %c - %m%n].
log4j: End of parsing for "application".
log4j: Setting property [file] to [c:/brol7/application.log].
log4j: Setting property [append] to [false].
log4j: setFile called: c:/brol7/application.log, false
log4j: setFile ended
log4j: Parsed "application" options.
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%d [%t] %-5p %c - %m%n].
log4j: End of parsing for "stdout".
log4j: Setting property [file] to [c:/brol7/application2.log].
log4j: Setting property [append] to [false].
log4j: setFile called: c:/brol7/application2.log, false
log4j: setFile ended
log4j: Parsed "stdout" options.
log4j: Finished configuring.

init:
Trying to override old definition of task assert
Trying to override old definition of task foreach
     [echo] C:\brol7/results/bu

loop:

clean-logfiles:
     [echo] 07/15/2009 05:29 PM
     [echo] C:\brol7/results/bu

loop_through_list:
     [echo] Content C:\brol7/testplans//contexts.txt file:bet_server


The output continues to come in the console....

The correct log4j.properties files is used (meaning:
file:/C:/brol7/log4j.properties).

I have the impression it has something todo with JMeter and the way JMEter
sends it output ?

When I startup with:

ant -logfile results/log/monitor.log -buildfile monitor.xml

nothing is send to the console.

But I need to have a rolling appender otherwise the monitor.log files keeps
growing endlessly...

Strange to me....

S.








SGE0 wrote:
> 
> Hi,
> 
> I have been using Ant & Jmeter successfully the last months.
> 
> No I want to use the log4j package to have more control on the logging of
> messages
> 
> I have a log4j.properties file with following contents:
> 
> 
>  
>   log4j.rootCategory=WARN,application,stdout, 
> 
>  
>   #out to console
>   #log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>   #log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>   #log4j.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x
> -%m%n
> 
> 
>   log4j.appender.stdout= org.apache.log4j.FileAppender
>   log4j.appender.stdout.file = c:/brol7/application2.log
>   log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
>   log4j.appender.stdout.layout.conversionPattern = %d [%t] %-5p %c - %m%n
>   log4j.appender.stdout.append = false
>  
>   #out to file
>   log4j.appender.application = org.apache.log4j.FileAppender
>   log4j.appender.application.file = c:/brol7/application.log
>   log4j.appender.application.layout = org.apache.log4j.PatternLayout
>   log4j.appender.application.layout.conversionPattern = %d [%t] %-5p %c -
> %m%n
>   log4j.appender.application.append = false
> 
> 
> At startup I get following;
> 
> Buildfile: monitor.xml
> log4j: Trying to find [log4j.properties] using context classloader
> java.net.URLC
> lassLoader@de6ced.
> log4j: Using URL [file:/C:/brol7/log4j.properties] for automatic log4j
> configura
> tion.
> log4j: Reading configuration from URL file:/C:/brol7/log4j.properties
> log4j: Parsing for [root] with value=[WARN,application,stdout, stderr].
> log4j: Level token is [WARN].
> log4j: Category root set to WARN
> log4j: Parsing appender named "application".
> log4j: Parsing layout options for "application".
> log4j: Setting property [conversionPattern] to [%d [%t] %-5p %c - %m%n].
> log4j: End of parsing for "application".
> log4j: Setting property [file] to [c:/brol7/application.log].
> log4j: Setting property [append] to [false].
> log4j: setFile called: c:/brol7/application.log, false
> log4j: setFile ended
> log4j: Parsed "application" options.
> log4j: Parsing appender named "stdout".
> log4j: Parsing layout options for "stdout".
> log4j: Setting property [conversionPattern] to [%d [%t] %-5p %c - %m%n].
> log4j: End of parsing for "stdout".
> log4j: Setting property [file] to [c:/brol7/application2.log].
> log4j: Setting property [append] to [false].
> log4j: setFile called: c:/brol7/application2.log, false
> log4j: setFile ended
> log4j: Parsed "stdout" options.
> log4j: Parsing appender named "stderr".
> log4j: Parsing layout options for "stderr".
> log4j: Setting property [conversionPattern] to [%d [%t] %-5p %c - %m%n].
> log4j: End of parsing for "stderr".
> log4j: Setting property [append] to [false].
> log4j: Setting property [file] to [c:/brol7/application3.log].
> log4j: setFile called: c:/brol7/application3.log, false
> log4j: setFile ended
> log4j: Parsed "stderr" options.
> log4j: Finished configuring.
> 
> 
> The problem is that the messages (generated by JMeter and Ant build file)
> keep coming in the console.
> 
> Some one an idea of how to solve this ?
> 
> Stefan
> 
> 
:-)
-- 
View this message in context: http://www.nabble.com/JMeter-and-Ant-Logging-tp24487650p24501652.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Mime
View raw message