Request Logger
Serves an HTTP server on port 3000 and logs any requests to a file, stdout, and the response body.
This is not intended for production use. It is just a simple diagnostic tool for short-term testing.
General use
- Install Docker: sudo apt install docker.io
- Create an empty log file: touch requests.log
- Run a container:
docker run \
  --name reqlog \
  --restart always \
  -d \
  -p 3000:3000 \
  -v $(pwd)/requests.log:/requests.log \
  git.roeber.dev/jon/reqlog:v0.0.1
- Test:
curl \
  -X POST \
  http://localhost:3000/ \
  -H "Content-Type: application/json" \
  -d '{"temp": 98.6}'
The request gets logged to requests.log, printed to stdout (if running a container in daemon mode, check stdout with docker logs reqlog), and returned in the response body.
Description
				
					Languages
				
				
								
								
									Go
								
								83.4%
							
						
							
								
								
									Dockerfile
								
								16.6%