Redirecting agent output to a file

In some scenarios, it may be desirable to redirect the output generated by agents to a file rather than to the test client. This may be useful in a couple of different scenarios. First, in order to run the agent headless, that is, without a test client, redirecting output to a file eliminates the need for a test client. Second, this would be helpful in scenarios where large amounts of data is being output by the agent beyond what would be reasonable to buffer using the data channel. Streaming this data to a file is faster than streaming it directly to the test client for processing.

To redirect agent output to a file:

  1. Locate the serviceconfig.xml configuration file. See the related task.
  2. Open it in an editor, and search for the Agent element.
  3. Add the logFile attribute to the Agent element.
    For example, to redirect all the output from the Java Profiling Agent to the profile.trcxml file in the tmp directory, specify the logFile attribute with value /tmp/profile.trcxml

    <Agent name="Java Profiling Agent" type="Profiler" logFile="/tmp/profile.trcxml"> </Agent>

Related tasks
Locating the configuration files
Configuring logging
Administering the Agent Controller