1 Reply Latest reply on May 13, 2012 4:15 PM by glenn.s

    System.out.println during load testing ?

      I am running load test say with (10 concurrent users) and Open script has some System.out.printlns and some info statements.
      When I play back from open script editor, they are displayed in console and Result tabs.
      But when running a load test,
      1. does OATS write System.out.printlns or info things to any place ?
      2, or do I need to add loggers ? (Any example would be appreciated)
        • 1. Re: System.out.println during load testing ?
          You should not use System.out.println in either case. In your code use getLogger:
          getLogger().info("This is information");
          getLogger().warn("This is a warning");
          getLogger().error("This is an error");
          Modify both Log4j.xml files related to each playback. For OLT the agent log file will be saved in C:\OracleATS\logs
          OpenScript: C:\OracleATS\OpenScript.
          Load OLT: C:\OracleATS\Agent

          Then whenever you need, change priority values in log4j.xml to DEBUG, WARN, or INFO. Setting to DEBUG will log all three, WARN will log only WARN and INFO, and INFO just info. Make sure the category is not commented out by surrounding <!-- and -->.
            <priority value="DEBUG"/> 
            <appender-ref ref="AGENTFILE" /> 
            <appender-ref ref="CONSOLE" />
          There are 5 or 6 log4j examples in each products dir called e.g. log4jDebug.xml and log4jHTTP.xml that you must rename to only log4j.xml (backup your original). If you look close at those examples you can see how instead of logging every internal jagent modules with the "<root>" category, you can change the category to only log things from only script code or, for example, only HTTP request headers. You will find if you put debug in the "<root>" category that your log file will grow fast.