Forum Discussion

ITAbteilung's avatar
ITAbteilung
Contributor
11 years ago

Change Logfolder Wargenerator

Hi there,

we are deploying Mockups to an applicationserver using wardeployer.sh . At the moment, logfiles are stored at the location, from where we execute wardeployer.sh . Now we want to define the destination of the logfiles.

We tried to use add an argument to the java call of com.eviware.soapui.tools.SoapUIProMockAsWarGenerator . We tried:

-Dsoapui.logroot=logfolder

but it did not work.

Do you have an advice please?

Thanks in advance,
best regards,
Gilbert

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    This class accepts the following options:

    "x",  "Specify if libraries in ext folder should be included" 
    "a", "Specify if custom actions should be included"
    "l", "Specify if custom listeners should be included"
    "w", "Specify if web UI should be enabled"
    "e", "Set the local endpoint of the MockService"
    "f", "Specify the name of the generated WAR file"
    "d", "Sets the local folder to use for war generation"
    "s", "Sets the soapui-settings.xml file to use"
    "p", "Sets project password for decryption if project is encrypted"
    "v", "Sets password for soapui-settings.xml file"


    I believe you cannot modify the log directory through a command-line option. Please try to add a log4j.xml file in the same directory where you run the command. The class used for logging is "org.apache.log4j.Logger".

    Hope this helps,

    Renato
    SmartBear Software
  • In the folder where wardeployer.sh is called I created a file called "log4.xml", containing the following configuration:


    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

    <appender name="MeinAppender" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="datePattern" value="'.'yyyy-MM-dd_HH-mm" />
    <param name="file" value="MyLogFile.log" />
    <param name="Append" value="true" />
    <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value="%d{ISO8601} %-5p [%t] %c: %m%n" />
    </layout>
    </appender>

    <root>
    <priority value="INFO" />
    <appender-ref ref="MeinAppender" />
    </root>

    </log4j:configuration>


    That does not affect anything. No "MyLogFile.log" and still these 3 files are created:

    global-groovy.log
    soapui.log
    soapui-errors.log


    Kind regards,
    Gilbert
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Please use the following argument to SoapUIProMockAsWarGenerator to use your own log4j properties
    -Dsoapui.log4j.config=Your-log4j.xml


    I would also recommend that you copy soapui-log4j.xml content and make your directory related changes on top of that, so that your new configuration doesn't break third party library's log settings.

    //Shadid
    SmartBear Sweden