Unanswered question

How to log Javascript output in Linux and Windows LGs

I use a Javascript to log some details(variables, correlated data) and write output a file. For the load test I use Windows server as controller and combination of Windows and Linux(Ubuntu) LGs.

I wanted to understand how output of javascript gets logged in Ubuntu LGs?

Ex – Per https://www.neotys.com/blog/best-solutions-saving-values-..., output path can be set incase of windows LGs as below –
var writer = new java.io.FileWriter(“c:\\log.txt”,true);

How can set location and access the logs if I use combination of Windows and Linux LGs?

Is there a way to instruct Controller to copy over the output logs to Controller from all the LGs at the end of load test?

Deepak S.
Deepak S.

Deepak S.

Level
0
17 / 100
points

Answers

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

First of all the controller can't be instructed to copy your external files at the end of the test. Only the LG log files are automatically gathered by the controller.

Now regarding your path issue i would suggest you to use the ${NL-CustomResources} variable as path since it will be automatically converted to an absolute path on the load generator whatever the OS.

On Linux that path will be for example: $HOME/.neotys/neoload/v7.9/custom-resources where $HOME is the home user folder who started the LG agent.

On Windows this path will look like: %APPDATA%\Neotys\NeoLoad\v7.9\custom-resources

Deepak S.
Deepak S.

Deepak S.

Level
0
17 / 100
points

Thanks Nouredine!
So, if we want to refer to a file location both on Windows and Linux LG using a common Javascript can I use below -
var writer = new java.io.FileWriter("NL-CustomResources\\log.txt",true);