How do I change log file location (soapui.log soapui-errors.log)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2008
10:52 AM
03-03-2008
10:52 AM
How do I change log file location (soapui.log soapui-errors.log)
HI,
I'm using Soapui-2.0 on a RH Linux box, I'm a build engineer calling Ant from Hudson (sort of like cruise control but better imho) . i'm exec-ing a script to call a modified version of testrunner.sh and have hacked testrunner.sh to run with the following flags -a -j -h $host -f $resultsdir $xmlfile. The problem I have is the log files (soapui.log and soapui-errors.log) are being written to the ANT parent directory. I can probably change the location to SOAPUI_HOME by doing a chdir to SOAPUI_HOME in my script, However that would put all the log files from every build there.
I've been reading about soapui-log4j.xml , and soapui.properties but I can't find any examples of either, and have exactly zero experience writing log4j.xml files.
I would like to have a way to write the log files to a results directory that gets clobbered before every run.
Thanks in advance for any help
Pete
I'm using Soapui-2.0 on a RH Linux box, I'm a build engineer calling Ant from Hudson (sort of like cruise control but better imho) . i'm exec-ing a script to call a modified version of testrunner.sh and have hacked testrunner.sh to run with the following flags -a -j -h $host -f $resultsdir $xmlfile. The problem I have is the log files (soapui.log and soapui-errors.log) are being written to the ANT parent directory. I can probably change the location to SOAPUI_HOME by doing a chdir to SOAPUI_HOME in my script, However that would put all the log files from every build there.
I've been reading about soapui-log4j.xml , and soapui.properties but I can't find any examples of either, and have exactly zero experience writing log4j.xml files.
I would like to have a way to write the log files to a results directory that gets clobbered before every run.
Thanks in advance for any help
Pete
6 REPLIES 6
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2008
03:33 PM
03-03-2008
03:33 PM
Hi Pete,
you can modify the soapui-log4j.xml file in the soapui-2.0.2.jar and put the modified file into the soapui\bin folder. Change the FILE and ERRORFILE appenders File parameter to the desired location.
Hope this helps!
regards,
/Ole
eviware.com
you can modify the soapui-log4j.xml file in the soapui-2.0.2.jar and put the modified file into the soapui\bin folder. Change the FILE and ERRORFILE appenders File parameter to the desired location.
Hope this helps!
regards,
/Ole
eviware.com
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2008
09:50 AM
03-04-2008
09:50 AM
Thank you this works.
I was able to set it as a variable. I added an additional flag to testrunner.sh
soapui_log_dir=$4
then passed it to to java.
java -Dsoapui.properties=soapui.properties -
Dsoapui.log.dir=${soapui_log_dir} -cp $SOAPUI_CLASSPATH com.eviware.soapui.tools.SoapUITestCaseRunner $options
This allows me to define the log dir on the fly from my ant task that kicks off the soap ui tests.
In the soapui-log4j.xml file I changed the lines you suggested to
I was able to set it as a variable. I added an additional flag to testrunner.sh
soapui_log_dir=$4
then passed it to to java.
java -Dsoapui.properties=soapui.properties -
Dsoapui.log.dir=${soapui_log_dir} -cp $SOAPUI_CLASSPATH com.eviware.soapui.tools.SoapUITestCaseRunner $options
This allows me to define the log dir on the fly from my ant task that kicks off the soap ui tests.
In the soapui-log4j.xml file I changed the lines you suggested to
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2008
12:48 PM
03-04-2008
12:48 PM
Hi!
cool! Thanks for sharing!
regards,
/Ole
eviware.com
cool! Thanks for sharing!
regards,
/Ole
eviware.com
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2009
01:47 AM
10-22-2009
01:47 AM
Another way I found out is described below.
This was needed for integrating SoapUI in a test utility (web application) for generating requests and responses based on the WSDL. This prevents the logs of the server/application to disappear from the server log file. To make it complete, I've also added a part of the WSDLMessageGenerator.
if ( wsdlgen == null ) {
// Make sure we maintain the environment
SoapUI.setSoapUICore(new ServerSoapUICore());
wsdlgen = new WSDLMessageGenerator();
}
---------
public class ServerSoapUICore extends DefaultSoapUICore {
@Override
protected void initLog() {
// We keep on using the log of the server....
log = Logger.getLogger( DefaultSoapUICore.class );
}
@Override
public Settings getSettings() {
if ( log == null ) {
initLog();
}
return super.getSettings();
}
}
---------------------
public class WSDLMessageGenerator {
private WsdlProject project;
private WsdlInterface iface;
public WSDLMessageGenerator() throws Exception {
project = new WsdlProject();
}
....
WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, wsdlLocation);
iface = wsdls[0];
}
Hope it helps!
Mike.
This was needed for integrating SoapUI in a test utility (web application) for generating requests and responses based on the WSDL. This prevents the logs of the server/application to disappear from the server log file. To make it complete, I've also added a part of the WSDLMessageGenerator.
if ( wsdlgen == null ) {
// Make sure we maintain the environment
SoapUI.setSoapUICore(new ServerSoapUICore());
wsdlgen = new WSDLMessageGenerator();
}
---------
public class ServerSoapUICore extends DefaultSoapUICore {
@Override
protected void initLog() {
// We keep on using the log of the server....
log = Logger.getLogger( DefaultSoapUICore.class );
}
@Override
public Settings getSettings() {
if ( log == null ) {
initLog();
}
return super.getSettings();
}
}
---------------------
public class WSDLMessageGenerator {
private WsdlProject project;
private WsdlInterface iface;
public WSDLMessageGenerator() throws Exception {
project = new WsdlProject();
}
....
WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, wsdlLocation);
iface = wsdls[0];
}
Hope it helps!
Mike.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2012
06:20 AM
01-13-2012
06:20 AM
FYI:
For SoapUI version 4 option -Dsoapui.log.dir is not valid anymore
the proper name is -Dsoapui.logroot
For SoapUI version 4 option -Dsoapui.log.dir is not valid anymore
the proper name is -Dsoapui.logroot
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2013
07:33 AM
04-26-2013
07:33 AM
also not valid for 3.6.1
use -Dsoapui.logroot as for 4.x version
use -Dsoapui.logroot as for 4.x version
