title: How to write soapUI groovy script log into text file
body: <p>I have to write Groovy script log in to a text file, I am able to write request and response of any Soap step using <code>context.expand</code>.</p>
  
  <p>To write test request and response I am using:</p>
  
  <pre><code>def request =  context.expand('${SoapRequest#Request}')
  new File ("D:/RequestFile.txt").write(request)
  </code></pre>
  
  <p>What I want is to save the <em>log output</em> in a file:</p>
  
  <p><a href="https://i.stack.imgur.com/tzvpK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tzvpK.png" alt="enter image description here"></a></p>
  
  <p>Suggest me a way to write Groovy script log in a text file.</p>