You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Cyril Scetbon <cy...@free.fr> on 2011/11/29 22:09:07 UTC

using debug in Java request sampler

Hi,

I'm using the sample code SleepTest.java Java Request sampler and can't 
see debug information logged using getLogger().debug() even if I enable 
debug mode from menu help>Enable debug (getLogger().isDebugEnabled() 
always return false but I see debug information in jmeter.log as follow :

2011/11/29 21:53:19 DEBUG - jmeter.protocol.java.sampler.JavaSampler: 
Java Thread Group Readers 1-1@38fbdc9b-Java RequesterCreating Java Client
2011/11/29 21:53:19 DEBUG - jmeter.protocol.java.sampler.JavaSampler: 
Java Thread Group Readers 1-1@38fbdc9b-Java Requester    Created:    
org.apache.jmeter.protocol.java.test.SleepTest@28c2f254
2011/11/29 21:53:20 DEBUG - jmeter.protocol.java.sampler.JavaSampler: 
StandardJMeterEngine@2dbf20f6-Java Requester    testEnded

what did I miss ?

thanks

-- 
Cyril SCETBON


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


Re: using debug in Java request sampler

Posted by Cyril Scetbon <cy...@free.fr>.
On 12/7/11 5:57 PM, sebb wrote:
> On 7 December 2011 16:41, Cyril Scetbon<cy...@free.fr>  wrote:
>> I found the solution. I just need to add
>> log_level.jmeter.protocol.java=DEBUG in jmeter.properties.
>>
>> Anyone knows if it's possible to set the level to the jmeter level. That is
>> to say, if I enable debug in jmeter gui it gets the same level for the
>> package jmeter.protocol.java ?
> Not possible, because the test class for the GUI is
> org.apache.jmeter.protocol.java.sampler.JavaSampler but the JavaClient
> implementations extend
> org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient.
>
> The GUI can only change the debug level for the corresponding test class.
Ok, thanks for this information.
>
>> On 12/6/11 8:56 AM, Cyril Scetbon wrote:
>>> On 12/6/11 12:43 AM, sebb wrote:
>>>> The info is in the source - there are no logging calls in the SleepTest
>>>> code.
>>> Wrong !
>>>
>>> private void listParameters(JavaSamplerContext context) {
>>>         if (*getLogger().isDebugEnabled()*) {
>>>
>>>             Iterator<String>  argsIt = context.getParameterNamesIterator();
>>>             while (argsIt.hasNext()) {
>>>                 String name = argsIt.next();
>>> *getLogger().debug(name + "=" + context.getParameter(name));*
>>>
>>>             }
>>>         }
>>>     }
>>>
>>> Did you really check the sources ?
>>>
>>> the matter is that the logger is provided by jmeter and so should get all
>>> the events that the class sends when debug mode is enabled. However, even I
>>> enable DEBUG mode in jmeter, I see DEBUG logs except the one sent from the
>>> java request classes :(
>>> Maybe there's a configuration parameter that disables it (as
>>> getLogger().isDebugEnabled() is always false)
>>>
>>> anyone else ?
>>>
>>
>> --
>> Cyril SCETBON
>>
>>
>> ---------------------------------------------------------------------
>> 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
>


-- 
Cyril SCETBON


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


Re: using debug in Java request sampler

Posted by sebb <se...@gmail.com>.
On 7 December 2011 16:41, Cyril Scetbon <cy...@free.fr> wrote:
> I found the solution. I just need to add
> log_level.jmeter.protocol.java=DEBUG in jmeter.properties.
>
> Anyone knows if it's possible to set the level to the jmeter level. That is
> to say, if I enable debug in jmeter gui it gets the same level for the
> package jmeter.protocol.java ?

Not possible, because the test class for the GUI is
org.apache.jmeter.protocol.java.sampler.JavaSampler but the JavaClient
implementations extend
org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient.

The GUI can only change the debug level for the corresponding test class.

>
> On 12/6/11 8:56 AM, Cyril Scetbon wrote:
>>
>> On 12/6/11 12:43 AM, sebb wrote:
>>>
>>> The info is in the source - there are no logging calls in the SleepTest
>>> code.
>>
>> Wrong !
>>
>> private void listParameters(JavaSamplerContext context) {
>>        if (*getLogger().isDebugEnabled()*) {
>>
>>            Iterator<String> argsIt = context.getParameterNamesIterator();
>>            while (argsIt.hasNext()) {
>>                String name = argsIt.next();
>> *getLogger().debug(name + "=" + context.getParameter(name));*
>>
>>            }
>>        }
>>    }
>>
>> Did you really check the sources ?
>>
>> the matter is that the logger is provided by jmeter and so should get all
>> the events that the class sends when debug mode is enabled. However, even I
>> enable DEBUG mode in jmeter, I see DEBUG logs except the one sent from the
>> java request classes :(
>> Maybe there's a configuration parameter that disables it (as
>> getLogger().isDebugEnabled() is always false)
>>
>> anyone else ?
>>
>
>
> --
> Cyril SCETBON
>
>
> ---------------------------------------------------------------------
> 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: using debug in Java request sampler

Posted by sebb <se...@gmail.com>.
On 7 December 2011 16:56, Adrian Speteanu <as...@gmail.com> wrote:
> In the properties file you can set the log level for individual components
> to whatever level you choose to, just uncomment the lines first.
>
> you can use two separate properties fiels, one for debuging the test script
> and one for performance tests, its easy to keep separate files and refer
> them in the command line (-p).

Or you can use the additonal property file command-line flag -q to
override the values, see:

http://jmeter.apache.org/usermanual/get-started.html#options

Or of course user.properties

> you can also set the logging level from the
> command line to override the properties file: -L
>
> "-L[category]=[priority] - overrides a logging setting, setting a
> particular category to the given priority level.
>
> The -L flag can also be used without the category name to set the root
> logging level."
>
>
> On Wed, Dec 7, 2011 at 6:41 PM, Cyril Scetbon <cy...@free.fr> wrote:
>
>> I found the solution. I just need to add log_level.jmeter.protocol.**java=DEBUG
>> in jmeter.properties.
>>
>> Anyone knows if it's possible to set the level to the jmeter level. That
>> is to say, if I enable debug in jmeter gui it gets the same level for the
>> package jmeter.protocol.java ?
>>
>>
>> On 12/6/11 8:56 AM, Cyril Scetbon wrote:
>>
>>> On 12/6/11 12:43 AM, sebb wrote:
>>>
>>>> The info is in the source - there are no logging calls in the SleepTest
>>>> code.
>>>>
>>> Wrong !
>>>
>>> private void listParameters(**JavaSamplerContext context) {
>>>        if (*getLogger().isDebugEnabled()***) {
>>>            Iterator<String> argsIt = context.**
>>> getParameterNamesIterator();
>>>            while (argsIt.hasNext()) {
>>>                String name = argsIt.next();
>>> *getLogger().debug(name + "=" + context.getParameter(name));*
>>>            }
>>>        }
>>>    }
>>>
>>> Did you really check the sources ?
>>>
>>> the matter is that the logger is provided by jmeter and so should get all
>>> the events that the class sends when debug mode is enabled. However, even I
>>> enable DEBUG mode in jmeter, I see DEBUG logs except the one sent from the
>>> java request classes :(
>>> Maybe there's a configuration parameter that disables it (as
>>> getLogger().isDebugEnabled() is always false)
>>>
>>> anyone else ?
>>>
>>>
>>
>> --
>> Cyril SCETBON
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.**apache.org<us...@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: using debug in Java request sampler

Posted by Adrian Speteanu <as...@gmail.com>.
In the properties file you can set the log level for individual components
to whatever level you choose to, just uncomment the lines first.

you can use two separate properties fiels, one for debuging the test script
and one for performance tests, its easy to keep separate files and refer
them in the command line (-p). you can also set the logging level from the
command line to override the properties file: -L

"-L[category]=[priority] - overrides a logging setting, setting a
particular category to the given priority level.

The -L flag can also be used without the category name to set the root
logging level."


On Wed, Dec 7, 2011 at 6:41 PM, Cyril Scetbon <cy...@free.fr> wrote:

> I found the solution. I just need to add log_level.jmeter.protocol.**java=DEBUG
> in jmeter.properties.
>
> Anyone knows if it's possible to set the level to the jmeter level. That
> is to say, if I enable debug in jmeter gui it gets the same level for the
> package jmeter.protocol.java ?
>
>
> On 12/6/11 8:56 AM, Cyril Scetbon wrote:
>
>> On 12/6/11 12:43 AM, sebb wrote:
>>
>>> The info is in the source - there are no logging calls in the SleepTest
>>> code.
>>>
>> Wrong !
>>
>> private void listParameters(**JavaSamplerContext context) {
>>        if (*getLogger().isDebugEnabled()***) {
>>            Iterator<String> argsIt = context.**
>> getParameterNamesIterator();
>>            while (argsIt.hasNext()) {
>>                String name = argsIt.next();
>> *getLogger().debug(name + "=" + context.getParameter(name));*
>>            }
>>        }
>>    }
>>
>> Did you really check the sources ?
>>
>> the matter is that the logger is provided by jmeter and so should get all
>> the events that the class sends when debug mode is enabled. However, even I
>> enable DEBUG mode in jmeter, I see DEBUG logs except the one sent from the
>> java request classes :(
>> Maybe there's a configuration parameter that disables it (as
>> getLogger().isDebugEnabled() is always false)
>>
>> anyone else ?
>>
>>
>
> --
> Cyril SCETBON
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.**apache.org<us...@jmeter.apache.org>
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: using debug in Java request sampler

Posted by Cyril Scetbon <cy...@free.fr>.
I found the solution. I just need to add 
log_level.jmeter.protocol.java=DEBUG in jmeter.properties.

Anyone knows if it's possible to set the level to the jmeter level. That 
is to say, if I enable debug in jmeter gui it gets the same level for 
the package jmeter.protocol.java ?

On 12/6/11 8:56 AM, Cyril Scetbon wrote:
> On 12/6/11 12:43 AM, sebb wrote:
>> The info is in the source - there are no logging calls in the 
>> SleepTest code.
> Wrong !
>
> private void listParameters(JavaSamplerContext context) {
>         if (*getLogger().isDebugEnabled()*) {
>             Iterator<String> argsIt = 
> context.getParameterNamesIterator();
>             while (argsIt.hasNext()) {
>                 String name = argsIt.next();
> *getLogger().debug(name + "=" + context.getParameter(name));*
>             }
>         }
>     }
>
> Did you really check the sources ?
>
> the matter is that the logger is provided by jmeter and so should get 
> all the events that the class sends when debug mode is enabled. 
> However, even I enable DEBUG mode in jmeter, I see DEBUG logs except 
> the one sent from the java request classes :(
> Maybe there's a configuration parameter that disables it (as 
> getLogger().isDebugEnabled() is always false)
>
> anyone else ?
>


-- 
Cyril SCETBON


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


Re: using debug in Java request sampler

Posted by Cyril Scetbon <cy...@free.fr>.
On 12/6/11 12:43 AM, sebb wrote:
> The info is in the source - there are no logging calls in the SleepTest code.
Wrong !

private void listParameters(JavaSamplerContext context) {
         if (*getLogger().isDebugEnabled()*) {
             Iterator<String> argsIt = context.getParameterNamesIterator();
             while (argsIt.hasNext()) {
                 String name = argsIt.next();
*getLogger().debug(name + "=" + context.getParameter(name));*
             }
         }
     }

Did you really check the sources ?

the matter is that the logger is provided by jmeter and so should get 
all the events that the class sends when debug mode is enabled. However, 
even I enable DEBUG mode in jmeter, I see DEBUG logs except the one sent 
from the java request classes :(
Maybe there's a configuration parameter that disables it (as 
getLogger().isDebugEnabled() is always false)

anyone else ?

-- 
Cyril SCETBON


Re: using debug in Java request sampler

Posted by sebb <se...@gmail.com>.
On 5 December 2011 22:19, Cyril Scetbon <cy...@free.fr> wrote:
> On 11/30/11 11:34 AM, Cyril Scetbon wrote:
>>
>> I tried with the sample SleepTest Java requester and didn't get debug
>> information too even if i enable debug in the jmeter console or try -LDEBUG
>> and -Ljmeter.DEBUG on the jmeter commandline
>>
> No info about this subject ?

The info is in the source - there are no logging calls in the SleepTest code.

>
>
> --
> Cyril SCETBON
>
>
> ---------------------------------------------------------------------
> 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: using debug in Java request sampler

Posted by Cyril Scetbon <cy...@free.fr>.
On 11/30/11 11:34 AM, Cyril Scetbon wrote:
> I tried with the sample SleepTest Java requester and didn't get debug 
> information too even if i enable debug in the jmeter console or try 
> -LDEBUG and -Ljmeter.DEBUG on the jmeter commandline
>
No info about this subject ?

-- 
Cyril SCETBON


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


Re: using debug in Java request sampler

Posted by Cyril Scetbon <cy...@free.fr>.
I tried with the sample SleepTest Java requester and didn't get debug 
information too even if i enable debug in the jmeter console or try 
-LDEBUG and -Ljmeter.DEBUG on the jmeter commandline

-- 
Cyril SCETBON


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