Forum Discussion

tom_13's avatar
tom_13
Contributor
17 years ago

Groovy log

Hello,
I'm using free soapUI. Can you tell me, please,
How I can save only Groovy log in file, after running my test project?

3 Replies

  • Hi Tom,


    Select "groovy log" tab, right click over log area and choose "Export to File".


    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla
  • Hi,
    Thanks’ for so quickly response, but I did mistake in question. I wanted to know how it can  be made automatically from script?
  • Hi Tom,


    OK, now I understand what you're after.

    There are two ways to do this - one for the soapUI installation (requires a bit of hacking) and one per soapUI project.

    1. Per soapUI project

    This is an elegant way to configure Groovy logging programmatically per soapUI project.
    You need to edit project's Load Script, which is loaded every time soapUI project is, well, loaded.

    import org.apache.log4j.*
    import com.eviware.soapui.SoapUI

    groovyLogLayout = new PatternLayout("%d [%t] %-5p %m%n")
    customGroovyLogAppender = new FileAppender(groovyLogLayout, "very-groovy.log")
    SoapUI.ensureGroovyLog().addAppender( customGroovyLogAppender )
    println "Project Load Script executed successfully" // if you need confirmation it really happened



    2. Per soapUI installation

    You need to modify soapui-log4j.xml file which is found inside $SOAPUI_HOME/lib/soapui-version.jar in com/eviware/soapui/resources/conf folder. To avoid working with a locked file, you should exit from soapUI prior to doing this. Extract and edit soapui-log4j.xml file and add a logger for soapui.log logger and configure it with an appropriate appender. Something like this:

       
         
         
         
         
         
         
         
           
         
       
       


       
         

       


    After you have modified soapui-log4j.xml file put it back into $SOAPUI_HOME/lib/soapui-version.jar file.

    I believe this is the solution you were after.


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


    p.s.  I've modified all post subjects in this thread to hold the title "Groovy log" instead of "Groove log".