Forum Discussion

rdebie's avatar
rdebie
Contributor
17 years ago

Automatic save log windows

It would be very nice when a log line in a log windows
also be written to a log file.

When debugging or testing a lot, the log window will erase lines
when there are more than n line's.

Raymond

9 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Raymond,

    this is actually possible currently by modifying the internal log4j configuration.. if you tell me which log you need I'll show you an example..

    (obviously this should be improved to be configured directly in the UI in a future version)

    regards!

    /Ole
    eviware.com
  • Ole,

    I want to export the groovy log  and some other log windows that
    i self created.

    It would be very nice when it can be configured directly in the UI by the future.

    greetings,

    raymond
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    ok.. I've attached a modified soapui-log4j.xml that you should save in your soapui-pro\bin directory, it adds the following to the standard configuration:

    <logger name="groovy.log">
      <appender-ref ref="GroovyFile"/>
    </logger>
     
    <appender name="GroovyFile" class="org.apache.log4j.FileAppender">
        <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
        <param name="File" value="soapui-groovy.log"/>
        <param name="Threshold" value="DEBUG"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p [%c{1}] %m%n"/>
        </layout>    
    </appender>


    ie it defines a file-appender which writes to a "soapui-groovy.log" file and associates it with the "groovy.log" category..

    If you want to add appenders to your own logs, just create a category named as yours and appropriate appenders..

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • Thanks Ole,

    I shall test this feature tomorrow.


    greetings,

    Raymond
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Raymond,

    the format is controlled by the ConversionPattern layout parameter in the config file.. if you change it to



    then the category wont be displayed any more..

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • Ole,

    Are the options for the ConversionPattern defined (described) somewhere ?

    Raymond