Skip to content

Commit 9edc554

Browse files
author
Michael Cuthbert
authored
Merge pull request #79 from osmlab/ljdelight/testLogging
Configure and document the simplelogger.properties for easier debugging
2 parents 90b2dc6 + feaeafb commit 9edc554

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,13 @@ Once you have fixed an issue or added a new feature, it is time to submit [a pul
5252
Building MapRoulette Java Client can be simply done using gradle:
5353
`./gradlew clean build`
5454

55-
#### Log4j Properties
55+
#### Log Levels
5656

57-
Make sure you first have a `log4j.properties` file in `src/main/resources`.
58-
Alternatively, you can have as a VM parameter:
57+
The unit tests and integration tests use the `slf4j-simple` logging framework.
5958

60-
```
61-
-Dlog4j.configuration=file://<path_to_config>
62-
```
59+
The log level defaults to `info` and can be changed within the test resources `./src/test/resources/simplelogger.properties`.
60+
Logging at the `trace` level will log all HTTP requests (and payloads) and all HTTP responeses (and payloads).
6361

64-
https://github.com/osmlab/maproulette-java-client/blob/dev/config/log4j/log4j.properties
6562

6663
#### IntelliJ Setup
6764

@@ -77,6 +74,8 @@ There also is an eclipse code formatting template [here](config/format/code_form
7774

7875
The codebase contains an extensive range of unit tests. Unit tests are supposed to run fairly fast. All the tests will be run for every pull request build, so make sure that it doesn't take an exceptionally long time to run! When contributing new code, make sure to not break existing tests (or modify them and explain why the modification is needed) and to add new tests for new features.
7976

77+
Using the `trace` logging level may help in finding the root cause of a test failure.
78+
8079
### Pull Request Guidelines
8180

8281
Pull requests comments should follow the template below:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The MapRoulette Java Client is a java library that makes it easy to create Proje
88

99
### Contributing
1010

11-
For contributing guidelines see [CONTRIBUTING.md](CONTRIBUTING.md).
11+
For contributing guidelines see [CONTRIBUTING.md](CONTRIBUTING.md). These guidelines are essential for anyone providing code contributions.
1212

1313
### API
1414

dependencies.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ project.ext.packages = [
1515
slf4j: [
1616
api: "org.slf4j:slf4j-api:${versions.slf4j}",
1717
simple: "org.slf4j:slf4j-simple:${versions.slf4j}",
18-
log4j12: "org.slf4j:slf4j-log4j12:${versions.slf4j}",
1918
],
2019
http: "org.apache.httpcomponents:httpclient:${versions.http}",
2120
checkstyle: "com.puppycrawl.tools:checkstyle:${versions.checkstyle}",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Change the logging level to 'trace' to view all HTTP request data and response data.
2+
org.slf4j.simpleLogger.defaultLogLevel=info

0 commit comments

Comments
 (0)