Forum Discussion

Pete_H's avatar
Pete_H
Occasional Contributor
17 years ago

Saving the Groovy Log

Hi-
Is there a way to output the groovy log to a file using a tear-down script?

I am aware that you can save the results by using the "Export to file" option- however I am running SoapUI in unix using a command line and I don't have an interface to save the Groovy log.

2 Replies

  • Hi!

    the groovy log internally is a standard log4j Logger, you could manually add your own FileAppender to it to get its contents to a file; for example add this in your setup script:

    com.eviware.soapui.SoapUI.ensureGroovyLog().addAppender( .. )

    Alternatively you could modify the soapui-log4j.xml file and configure your appender(s) there for the "groovy.log" category.

    Hope this helps!

    /Ole
    eviware.com
  • Hi everyone,


    Pete did not get back to us, but I believe he managed to achieve what he wanted with Ole's suggestion.

    I think Pete and everyone else might be interested in another, programmatic way (using Groovy script) to control where Groovy log messages is redirected. That includes in what file should logging messages be stored. This method allows per project configuration which Groovy log file to create.

    Just have a look at the post titled Groovy log for the detailed explanation of this method and the method Ole mentioned in this post.


    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla