Reputation: 2428
I'd like to set different directory for soapui logs so I made some corrections to soapui-log4j.xml
file:
<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
<errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
<param name="File" value="${soapui.logroot}soapui.log"/>
<!--param name="File" value="C:\Temp\soapui.log"/-->
<param name="Threshold" value="INFO"/>
<param name="Append" value="false"/>
<param name="MaxFileSize" value="5000KB"/>
<param name="MaxBackupIndex" value="50"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c{1}] %m%n"/>
</layout>
</appender>
E.g. simply change the name of the file:
<param name="File" value="${soapui.logroot}soapui_1.log"/>
Or change path:
<param name="File" value="C:\Temp\soapui.log"/>
But this does not help, file is not created at all after this changes. Should I change something else?
Upvotes: 2
Views: 2971
Reputation: 1
run testrunner in linux
cd /home/readyapi
/usr/local/readyapi2.3.0/bin/testrunner.sh -Dsoapui.log4j.config="/home/readyapi/config/soapui-log4j.xml" -r -a -j -f/usr/local/apache-tomcat-9.0.12/webapps/report "-RJUnit-Style HTML Report" -FXML -Eautotest "/home/readyapi/project/auto-api-riskcontrol-readyapi" &
-Dsoapui.log4j.config="/home/readyapi/config/soapui-log4j.xml" : use custom log4j config
"/home/readyapi/project/auto-api-riskcontrol-readyapi" : this is a composite project
notes: create folder "/home/readyapi/scripts" , put all scripts library when run testrunner.sh cd to folder "/home/readyapi" firstly , since testrunner loading scripts library under current folder.
Upvotes: 0
Reputation: 41
One fix to the logging exceptions is to run SOAPUI in Windows with elevated privileges. But I don't like to do that except as a very last resort.
If you are willing to edit some of the installed files, a better fix comes in two parts. (Rao's answer talks about defining a different configuration file for log4j, but you really only need to define one symbol which then subsequently gets used by log4j).
With a text editor, edit the file in a path similar to this (yes, it's the same file that Rao's answer tells you to edit, but the change is different):
C:\Program Files\SmartBear\SoapUI-5.3.0\bin\SoapUI-5.3.0.vmoptions
and point to your chosen logging folder by adding a line similar to
-Dsoapui.logroot=C:/Users/Test/.soapuios/logfiles/
I also found that I needed to edit the testrunner.bat, because the test runner doesn't run with the symbols that you've just added to SOAPUI. Using the same installation path as above, for me this is located at:
C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat
and you need to add an additional JAVA_OPTS near the end of the file which defines the same symbol that you placed into the .vmoptions file.
Finally, you might also want to edit the file toolrunner.bat (if you ever use those tools)
Upvotes: 0
Reputation: 21379
SoapUI uses log4j settings file from SOAPUI_HOME/bin/soapui-xxx.jar
file.
If it is required to override the configurations, pass the system property soapui.log4j.config
with respective log4j configuration file name as its value.
Add a line at the end of current configuration
-Dsoapui.log4j.config=/absolute/path/of/log4j.xml
NOTE: Use file path separator in unix style / even on windows. Also use the same style in log4.xml file as well for your customized log file paths.
Upvotes: 2