You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by waseemfa <fa...@gmail.com> on 2011/12/12 10:15:33 UTC

Create custom log files

Hi,

I have a scenario where i want to log a custom log details at each sampler
level.  Is there a ready way to do this task.  

I even want to create new folders on the run when the tests are executed
every time.  Can this be achieved.

Thanks in advance,
Waseem

--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5067691.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by Flavio Cysne <fl...@gmail.com>.
just add jmeter.properties keys in command line. Like this:

./jmeter -n -t myTest.jmx -l myResults.jtl
-Jjmeter.save.saveservice.response_data.on_error=false

If you want to change more options, just add more -Jkey=value as you need

Hope this helps you.
Flávio Cysne

2011/12/26 waseemfa <fa...@gmail.com>

> Just wanted to know is there a way to run JMeter (Non-GUI) mode and control
> the results we log in .jtl files?
>
> -Waseem
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5101469.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Create custom log files

Posted by apc <ap...@apc.kg>.
Well, I support your point, but for now JMeter has no ignoring feature and
the only way for us is
http://jmeter.apache.org/usermanual/test_plan.html#scoping_rules using
scoping rules (or custom listeners, but I now none with filtering abilities,
even in jp@gc).

-----
--
Andrey Pohilko
JP@GC Maintainer
--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5122647.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by sebb <se...@gmail.com>.
On 10 January 2012 12:52, waseemfa <fa...@gmail.com> wrote:
> Sebb,
>
> My thread group had the first sampler as BSF sampler where i initialize the
> variable and then have two HTTP Request sampler followed by a Result
> sampler.  I use the filename as "${test}.jtl" but it creates a jtl file as
> ${test}.jtl
>
> Not sure where the problem is.

"The variable has to be defined at the start of the test"
That was ambiguous, it means:

At the start of the test, the variable already needs to be set.

So use a Test Plan variable or Property.

> This is how my BSF sampler code looks like
>
> ${__setProperty(test,"C:\test\Result")};

That sets the property too late.

> OUT.println("Value is " + ${__property(test)});
>
> vars.put("test",${__property(test)});
>
>
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5134008.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Re: Create custom log files

Posted by waseemfa <fa...@gmail.com>.
Sebb,

My thread group had the first sampler as BSF sampler where i initialize the
variable and then have two HTTP Request sampler followed by a Result
sampler.  I use the filename as "${test}.jtl" but it creates a jtl file as
${test}.jtl

Not sure where the problem is.

This is how my BSF sampler code looks like

${__setProperty(test,"C:\test\Result")};

OUT.println("Value is " + ${__property(test)});

vars.put("test",${__property(test)});



--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5134008.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by sebb <se...@gmail.com>.
On 10 January 2012 09:52, waseemfa <fa...@gmail.com> wrote:
> Oh Sorry for the confusion.. I am referring to JMeter's native listeners.
>
> The problem seems to be that in the filename text box of the listener it
> doesn't appear to accept a variable name.  Just wanted to know if there is a
> way to achieving it.

It does accept a variable name, but the variable has to be defined at
the start of the test otherwise it is too late.

> -Waseem
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5133760.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Re: Create custom log files

Posted by waseemfa <fa...@gmail.com>.
Oh Sorry for the confusion.. I am referring to JMeter's native listeners.  

The problem seems to be that in the filename text box of the listener it
doesn't appear to accept a variable name.  Just wanted to know if there is a
way to achieving it.

-Waseem

--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5133760.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by apc <ap...@apc.kg>.
Do you ask of FFW behavior or JMeter's native listeners?

FFW will process variables in file name only when test starts, for first
sample. Then it will use this single file to write data.



-----
--
Andrey Pohilko
JP@GC Maintainer
--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5133758.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by waseemfa <fa...@gmail.com>.
Is there a way we can specify a filename using a variable or a user defined
property?

--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5133696.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
I usually find it much easier to post process the result file to remove
whatever I dont want. Its fairly easy to do this for both XML and CSV

regards
deepak

On Thu, Jan 5, 2012 at 4:41 AM, waseemfa <fa...@gmail.com> wrote:

> Sebb,
>
> Thats one way of approaching the problem and its really a great way of
> doing
> it.. But when the number of samplers increase this means the overhead
> increases.  So having a global listener and ignoring few of the samplers
> should be a better way.  Just not sure if this could be achieved.
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5122509.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Create custom log files

Posted by waseemfa <fa...@gmail.com>.
Sebb,

Thats one way of approaching the problem and its really a great way of doing
it.. But when the number of samplers increase this means the overhead
increases.  So having a global listener and ignoring few of the samplers
should be a better way.  Just not sure if this could be achieved.

--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5122509.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by sebb <se...@gmail.com>.
On 5 January 2012 11:35, waseemfa <fa...@gmail.com> wrote:
> Based on the methods given in
>
> http://jmeter.apache.org/api/org/apache/jmeter/samplers/SampleResult.html
>
> Is there a way where we can ignore to log the output of a particular sampler
> and log for only those samplers that we actually want

Listeners only log samples from samplers that are in scope.

For example, add a Listener as a child of a sampler and it will only
log samples for that sampler.

>
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5122428.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Re: Create custom log files

Posted by waseemfa <fa...@gmail.com>.
Based on the methods given in 

http://jmeter.apache.org/api/org/apache/jmeter/samplers/SampleResult.html

Is there a way where we can ignore to log the output of a particular sampler
and log for only those samplers that we actually want



--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5122428.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by Felix Frank <ff...@mpexnet.de>.
On 01/05/2012 12:28 PM, sebb wrote:
>> If you need additional info about each of your Samples, that won't be
>> > easy (if at all possible).
> http://jmeter.apache.org/usermanual/listeners.html#sample_variables

Fascinating! Thanks.

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


Re: Create custom log files

Posted by sebb <se...@gmail.com>.
On 5 January 2012 08:18, Felix Frank <ff...@mpexnet.de> wrote:
> Hi,
>
> On 01/05/2012 07:53 AM, waseemfa wrote:
>> Thanks a lot for all your replies guys!! really appreciated
>>
>> Just wanted to know one more thing.  Is there a way where we can add our own
>> data into the Sample data writer by creating a new configuration element?
>
> Define "your own data".
>
> If you need additional info about each of your Samples, that won't be
> easy (if at all possible).

http://jmeter.apache.org/usermanual/listeners.html#sample_variables

> If you want additional custom sample data, that might be possible by
> adding BeanShellSamplers or similar to your Test Plan.
>
> HTH,
> Felix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Re: Create custom log files

Posted by Felix Frank <ff...@mpexnet.de>.
Hi,

On 01/05/2012 07:53 AM, waseemfa wrote:
> Thanks a lot for all your replies guys!! really appreciated
> 
> Just wanted to know one more thing.  Is there a way where we can add our own
> data into the Sample data writer by creating a new configuration element?

Define "your own data".

If you need additional info about each of your Samples, that won't be
easy (if at all possible).

If you want additional custom sample data, that might be possible by
adding BeanShellSamplers or similar to your Test Plan.

HTH,
Felix

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


Re: Create custom log files

Posted by waseemfa <fa...@gmail.com>.
Thanks a lot for all your replies guys!! really appreciated

Just wanted to know one more thing.  Is there a way where we can add our own
data into the Sample data writer by creating a new configuration element?



--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5121942.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by Felix Frank <ff...@mpexnet.de>.
Hi,

On 12/27/2011 02:33 AM, Flavio Cysne wrote:
> Listeners are disabled during non-GUI test. They only make a difference in
> GUI mode when they are able export data to files (graphics or text).

as far as I know, the "-l file.jtl" implies a SimpleDataWriter Listener,
which will probably honor the defaults for Listeners, hence sebb's
reference.

Cheers,
Felix

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


Re: Create custom log files

Posted by Flavio Cysne <fl...@gmail.com>.
@Sayantani

No. Listeners, I mean the GUI Listeners menu items, like View Results Tree.

2011/12/27 Sayantani <sa...@gmail.com>

> @Flavio
> When you say "Listeners are disabled during non-GUI test" does it mean
> that the test results are not saved?
>
> On 12/27/11, Flavio Cysne <fl...@gmail.com> wrote:
> > @sebb
> >
> > Listeners are disabled during non-GUI test. They only make a difference
> in
> > GUI mode when they are able export data to files (graphics or text).
> >
> > 2011/12/26 sebb <se...@gmail.com>
> >
> >> On 26 December 2011 12:25, waseemfa <fa...@gmail.com> wrote:
> >> > Just wanted to know is there a way to run JMeter (Non-GUI) mode and
> >> control
> >> > the results we log in .jtl files?
> >>
> >> http://jmeter.apache.org/usermanual/listeners.html#defaults
> >>
> >> > -Waseem
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5101469.html
> >> > Sent from the JMeter - User mailing list archive at Nabble.com.
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> >> > For additional commands, e-mail: user-help@jmeter.apache.org
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> >> For additional commands, e-mail: user-help@jmeter.apache.org
> >>
> >>
> >
>
>
> --
>
> Thank you,
> Sayantani
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Create custom log files

Posted by Sayantani <sa...@gmail.com>.
@Flavio
When you say "Listeners are disabled during non-GUI test" does it mean
that the test results are not saved?

On 12/27/11, Flavio Cysne <fl...@gmail.com> wrote:
> @sebb
>
> Listeners are disabled during non-GUI test. They only make a difference in
> GUI mode when they are able export data to files (graphics or text).
>
> 2011/12/26 sebb <se...@gmail.com>
>
>> On 26 December 2011 12:25, waseemfa <fa...@gmail.com> wrote:
>> > Just wanted to know is there a way to run JMeter (Non-GUI) mode and
>> control
>> > the results we log in .jtl files?
>>
>> http://jmeter.apache.org/usermanual/listeners.html#defaults
>>
>> > -Waseem
>> >
>> > --
>> > View this message in context:
>> http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5101469.html
>> > Sent from the JMeter - User mailing list archive at Nabble.com.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> > For additional commands, e-mail: user-help@jmeter.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>
>


-- 

Thank you,
Sayantani

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


Re: Create custom log files

Posted by Flavio Cysne <fl...@gmail.com>.
@sebb

Listeners are disabled during non-GUI test. They only make a difference in
GUI mode when they are able export data to files (graphics or text).

2011/12/26 sebb <se...@gmail.com>

> On 26 December 2011 12:25, waseemfa <fa...@gmail.com> wrote:
> > Just wanted to know is there a way to run JMeter (Non-GUI) mode and
> control
> > the results we log in .jtl files?
>
> http://jmeter.apache.org/usermanual/listeners.html#defaults
>
> > -Waseem
> >
> > --
> > View this message in context:
> http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5101469.html
> > Sent from the JMeter - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Create custom log files

Posted by sebb <se...@gmail.com>.
On 26 December 2011 12:25, waseemfa <fa...@gmail.com> wrote:
> Just wanted to know is there a way to run JMeter (Non-GUI) mode and control
> the results we log in .jtl files?

http://jmeter.apache.org/usermanual/listeners.html#defaults

> -Waseem
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5101469.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Re: Create custom log files

Posted by waseemfa <fa...@gmail.com>.
Just wanted to know is there a way to run JMeter (Non-GUI) mode and control
the results we log in .jtl files?

-Waseem

--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5101469.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by waseemfa <fa...@gmail.com>.
Thanks for the reply sebb.  But that wasn't my requirement.

But any how figured that we can add custom response message to our request
so that pretty much solves my problem.
Creation of jtl files with user response messages will give a clear
understanding of the data used.

-Waseem



--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5071157.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Create custom log files

Posted by sebb <se...@gmail.com>.
On 12 December 2011 09:15, waseemfa <fa...@gmail.com> wrote:
> Hi,
>
> I have a scenario where i want to log a custom log details at each sampler
> level.  Is there a ready way to do this task.

http://jmeter.apache.org/usermanual/listeners.html#sample_variables

> I even want to create new folders on the run when the tests are executed
> every time.  Can this be achieved.

If the log files are defined with folder names, JMeter will create the
necessary folders when creating the log file.

> Thanks in advance,
> Waseem
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5067691.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Re: Create custom log files

Posted by apc <ap...@apc.kg>.
Hi, 
I just wrote a tutorial for custom logging, maybe you'll find it useful for
your case: http://code.google.com/p/jmeter-plugins/wiki/FFWTutorials

-----
--
Andrey Pohilko
JP@GC Maintainer
--
View this message in context: http://jmeter.512774.n5.nabble.com/Create-custom-log-files-tp5067691p5122678.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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