Gradle plugin: generate logback.xml even with missing gatling resources directory
See original GitHub issueCurrenly, logback.xml
is generated together with processGatlingResources
task.
When resources directory (src/gatling/resources
) is missing or users changes default location - the plugin may skip generation of logback.xml
at all.
This may lead to improper logging configuration.
Improve generation of logback configuration
This is refactoring
- Detect if gatling resources contains either
logback.xml
,logback.groovy
etc. Currently the file location is hardcoded, this should be changed to analyze source directories and only limit sources to gatling resources. - If gatling resources has logback configuration - do nothing.
- If gatling resources doesn’t include any logback config files - then
- generate logback.xml somewhere in
build
directory. A separate directory should be used, the file must not be put intobuild/resources
as now. The generated file is better to place intobuild/generated
to prevent interference with real resources processed by Gradle. - As now generated logback.xml should use
gatling.logLevel
parameter to configure root logger level
- generate logback.xml somewhere in
- Generated logback.xml should be passed to every forked JVM that executes Gatling via additional
-Dlogback.configurationFile
system property as logback docs explains. - Make sure current tests work.
- Add test cases for other files, like
logback.groovy
etc.
Add possibility to configure HTTP requests via gatling configuration closure
This is new feature
- Add a new parameter to
gatling
configuration closure- named
logHttp
- values: enum of [NONE, ALL, FAILURES]
- named
- during logback.xml generation
logHttp
should enable logger of HTTP request (io.gatling.xxx), according to passed value - create tests
Prevent logging misconfigurations and improve plugin UX
This is a new feature
- If a user puts
logback.xml
or similar to resources folder, but the same times useslogLevel
orlogHttp
parameters ofgatling
closure - plugin should throw an exception- as an option - WARN log should be logged, without an exception.
- create tests for this feature
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (19 by maintainers)
Top Results From Across the Web
Gatling logback file ignored by gradle.build - Google Groups
I'm calling Gatling as a *JavaExec* task from a Gradle build script. ... configuration files directly under src/test/resources (no *conf* folder anymore).
Read more >Logback can't find logback.xml even though it exists (on the ...
I set it up (using maven) and everything seems fine except that Logback reports it can't find the configuration file (but I'm able...
Read more >Configuration - Gatling
Configuration. Configure the logs with logback.xml, the configuration with gatling.conf, and the zip bundle command options. Gatling can be configured and ...
Read more >Debug Gatling Performance Test Scripts – 5 Essential Methods
Finally, you can configure Gatling logging by editing the logback.xml file. We created this file in the setup process for this project in...
Read more >Gatling Script & Create Gatling Project Using Maven Archetype
In this tutorial, we will understand the basic building blocks of a Gatling Script and create a Gatling Script Project in Maven /...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue became a mess, closing it.
Created #3948 #3949 #3950 #3951
Just for the record, the cause which started this issue seems to be the same problem as described in: