Log to File

In Groovy – you can log to a file easily

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
f = new File("C:\SoapUI_GrvyLog\log.txt")
f.append("Test1\r\n")

Note: Running this will create a directory “SoapUI_GrvyLog” along withe a file “log.txt” where the first line will read “Test1”. If you run this again it will add “Test1” to line 2 etc..

You can also work with the \r\n code where

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def define = "Defined Value"
f = new File("C:/Users/rlong/Desktop/SoapUILog/log.txt")
f.append("Test1"+" "+define+"\r\n")

Result: The result will combine “Test1” the Empty Space and the value in def “define”, so basically looking like “Test1 Defined Value”