How to stop logging Gatling Requests

54 views
Skip to first unread message

Zoé Thivet

unread,
May 23, 2018, 2:14:35 AM5/23/18
to Gatling User Group
Hello everyone,

Disclaimer: this is a copy of my SO post, and I'm sorry if it's beyond the forum's etiquette. I may find my answer here, more likely than on SO.

I'm monitoring many web pages (around 4000), whose URLs are fed by a CSV file in the same Gatling test.

The problem is the test lasts forever. I suppose (but it may not be true) that the logging activity takes a long time. So I want to stop having the huge log table with 

    ---- Requests ------------------------------------------------------------------
    > Whatever
    > Blah blah blah
    > And so on
    ---- Errors --------------------------------------------------------------------
    > You got it

... only to see if it makes my test last a bit shorter.

How should I do?

I tried editing my `logback-test.xml` file but the logs show even with the ERROR level.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    
        <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
                <pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
                <immediateFlush>true</immediateFlush>
            </encoder>
        </appender>
    
        <root level="ERROR">
            <appender-ref ref="CONSOLE" />
        </root>
    
    </configuration>

Also, for all purposes, here is my pom.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>dead_url_spotter</groupId>
        <artifactId>dead_url_spotter</artifactId>
        <version>1.0-SNAPSHOT</version>
    
        <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <scala.version>2.11.7</scala.version>
            <encoding>UTF-8</encoding>
    
            <gatling.version>2.2.3</gatling.version>
    
            <scala-maven-plugin.version>3.2.2</scala-maven-plugin.version>
            <gatling.maven.version>2.2.1</gatling.maven.version>
        </properties>
    
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>io.gatling</groupId>
                    <artifactId>gatling-app</artifactId>
                    <version>${gatling.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.gatling</groupId>
                    <artifactId>gatling-recorder</artifactId>
                    <version>${gatling.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.gatling.highcharts</groupId>
                    <artifactId>gatling-charts-highcharts</artifactId>
                    <version>${gatling.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.scala-lang</groupId>
                    <artifactId>scala-library</artifactId>
                    <version>${scala.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.typesafe.scala-logging</groupId>
                    <artifactId>scala-logging_2.12</artifactId>
                    <version>3.7.2</version>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
        <dependencies>
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>LATEST</version>
            </dependency>
            <dependency>
                <groupId>io.gatling.highcharts</groupId>
                <artifactId>gatling-charts-highcharts</artifactId>
            </dependency>
            <dependency>
                <groupId>io.gatling</groupId>
                <artifactId>gatling-app</artifactId>
            </dependency>
            <dependency>
                <groupId>io.gatling</groupId>
                <artifactId>gatling-recorder</artifactId>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
            </dependency>
            <dependency>
                <groupId>com.googlecode.json-simple</groupId>
                <artifactId>json-simple</artifactId>
                <version>1.1.1</version>
            </dependency>
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>org.json</artifactId>
                <version>LATEST</version>
            </dependency>
            <dependency>
                <groupId>com.cedarsoftware</groupId>
                <artifactId>json-io</artifactId>
                <version>4.9.8</version>
            </dependency>
            <dependency>
                <groupId>org.jmxtrans</groupId>
                <artifactId>jmxtrans</artifactId>
                <version>263</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.jsoup</groupId>
                <artifactId>jsoup</artifactId>
                <version>1.11.2</version>
            </dependency>
        </dependencies>
    
        <build>
            <testSourceDirectory>src/test/java</testSourceDirectory>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <version>${scala-maven-plugin.version}</version>
                    </plugin>
                </plugins>
            </pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.2.1</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>java</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>io.gatling</groupId>
                    <artifactId>gatling-maven-plugin</artifactId>
                    <version>2.2.1</version>
                    <configuration>
                        <jvmArgs>
                            <jvmArg>-Durl=http://localhost:9000</jvmArg>
                            <jvmArg>-DnumberOfUsers=10</jvmArg>
                            <jvmArg>-DnumberOfRepetitions=1</jvmArg>
                            <jvmArg>-DdurationMinutes=1</jvmArg>
                            <jvmArg>-DpauseBetweenRequestsMs=3000</jvmArg>
                            <jvmArg>-Ddebug=false</jvmArg>
                        </jvmArgs>
                        <configFolder>src/test/resources</configFolder>
                        <dataFolder>src/test/resources/data</dataFolder>
                        <resultsFolder>target/gatling/results</resultsFolder>
                        <bf>src/test/resources/bodies</bf>
                        <simulationsFolder>src/test/scala</simulationsFolder>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                            <configuration>
                                <args>
                                    <arg>-Ybackend:GenBCode</arg>
                                    <arg>-Ydelambdafy:method</arg>
                                    <arg>-target:jvm-1.8</arg>
                                    <arg>-deprecation</arg>
                                    <arg>-feature</arg>
                                    <arg>-unchecked</arg>
                                    <arg>-language:implicitConversions</arg>
                                    <arg>-language:postfixOps</arg>
                                </args>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.20.1</version>
                    <configuration>
                        <skip>${skip.selenium.tests}</skip>
                        <parallel>none</parallel>
                        <threadCount>1</threadCount>
                        <reuseForks>false</reuseForks>
                        <disableXmlReport>false</disableXmlReport>
                    </configuration>
                    <executions>
                        <execution>
                            <id>runSeleniumTests</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>integration-test</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>

Thanks in advance for your help.

Stéphane LANDELLE

unread,
May 23, 2018, 2:35:09 AM5/23/18
to gat...@googlegroups.com
You're using a very old, outdated version of Gatling, please upgrade and report again if your test still doesn't stop.
The console logging has nothing to do with your test not stopping. You can disable it in gatling.conf.

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zoé Thivet

unread,
May 24, 2018, 7:49:57 PM5/24/18
to Gatling User Group
Hello Stéphane,

Thanks for mentionning gatling.conf, it did help me.

Have a good day.

Zoé
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages