8000 fix: log http method type in requests · Cleafy/elasticsearch-http-basic@695f23a · GitHub
[go: up one dir, main page]

Skip to content

Commit 695f23a

Browse files
author
emiguez
committed
fix: log http method type in requests
http method type was only log on unauthorized requests. This pr adds the method type to any request closes #42
1 parent 8ff2b9c commit 695f23a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Use `date "+%Y-%m-%d"` to get the correct date formatting
88
## [Unreleased][unreleased]
99
### - Added
1010
- allow HEAD root url authentication #39
11+
- log http method on any request. #42
1112

1213
## [1.5.0][2015-07-04]
1314

src/main/java/com/asquera/elasticsearch/plugins/http/HttpBasicServer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,11 @@ private boolean allowOptionsForCORS(HttpRequest request) {
204204

205205
public void logRequest(final HttpRequest request) {
206206
String addr = getAddress(request).getHostAddress();
207-
String t = "Authorization:{}, Host:{}, Path:{}, {}:{}, Request-IP:{}, " +
207+
String t = "Authorization:{}, type: {}, Host:{}, Path:{}, {}:{}, Request-IP:{}, " +
208208
"Client-IP:{}, X-Client-IP{}";
209209
logger.info(t,
210210
request.header("Authorization"),
211+
request.method(),
211212
request.header("Host"),
212213
request.path(),
213214
xForwardHeader,

0 commit comments

Comments
 (0)
0