Skip to content

Commit 12f5d86

Browse files
committed
Added info on enabling request/response logging (#228).
1 parent 94bac90 commit 12f5d86

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To utilize the GitLab API for Java in your project, simply add the following dep
1111
```java
1212
dependencies {
1313
...
14-
compile group: 'org.gitlab4j', name: 'gitlab4j-api', version: '4.8.38'
14+
compile group: 'org.gitlab4j', name: 'gitlab4j-api', version: '4.8.39'
1515
}
1616
```
1717

@@ -20,7 +20,7 @@ dependencies {
2020
<dependency>
2121
<groupId>org.gitlab4j</groupId>
2222
<artifactId>gitlab4j-api</artifactId>
23-
<version>4.8.38</version>
23+
<version>4.8.39</version>
2424
</dependency>
2525
```
2626

@@ -96,6 +96,23 @@ GitLabApi gitLabApi = new GitLabApi(ApiVersion.V3, "http://your.gitlab.server.co
9696
As of GitLab 11.0 support for the GitLab API v3 has been removed (see https://about.gitlab.com/2018/06/01/api-v3-removal-impending/). Support for GitLab API v3 will be removed from this library in January 2019. If you are utilizing the v3 support, please update your code before January 2019.
9797

9898

99+
---
100+
## Logging of API Requests and Responses
101+
As of GitLab4J-API 4.8.39 support has been added to log the requests to and the responses from the
102+
GitLab API. Enable logging using one of the following methods on the GitLabApi instance:
103+
```java
104+
GitLabApi gitLabApi = new GitLabApi("http://your.gitlab.server.com", "YOUR_PRIVATE_TOKEN");
105+
106+
// Log using the shared logger and default level of FINE
107+
gitLabApi.enableRequestResponseLogging();
108+
109+
// Log using the shared logger and the INFO level
110+
gitLabApi.enableRequestResponseLogging(java.util.logging.Level.INFO);
111+
112+
// Log using the specified logger and the INFO level
113+
gitLabApi.enableRequestResponseLogging(youtLoggerInstance, java.util.logging.Level.INFO);
114+
```
115+
99116
---
100117
## Results Paging
101118
GitLab4J-API provides an easy to use paging mechanism to page through lists of results from the GitLab API.

0 commit comments

Comments
 (0)