Goal
Find out what IP address a certain REST API request is coming from.
This information is not logged in httperr, stderr, or the conductor.log file.
Solution
The Jetty request log can be enabled by editing the start.ini file located within the Datameer installation folder. Add the following textblock to the bottom of the file:
# ---------------------------------------
# Module: requestlog
--module=requestlog
## Request Log Configuration
# Filename for Request Log output (relative to jetty.base)
# requestlog.filename=/logs/yyyy_mm_dd.request.log
# Date format for rollovered files (uses SimpleDateFormat syntax)
# requestlog.filenameDateFormat=yyyy_MM_dd
# How many days to retain the logs
requestlog.retain=7
# If an existing log with the same name is found, just append to it
requestlog.append=true
# Use the extended log output
# requestlog.extended=true
# Log http cookie information as well
# requestlog.cookies=true
This will create a new log file within the <Datameer Installation>/logs folder with a name of the format yyyy_mm_dd.request.log. The log file will contain all HTTP requests received by Jetty along with the IP address associated with the request.
Sample log output:
0:0:0:0:0:0:0:1 - - [16/Jun/2020:21:38:11 +0000] "GET / HTTP/1.1" 302 -
0:0:0:0:0:0:0:1 - - [16/Jun/2020:21:38:11 +0000] "GET /login HTTP/1.1" 200 -
Where the first entry in each log line is the IP address the request came from.
Comments
0 comments
Please sign in to leave a comment.