servertap-io / servertap

ServerTap is a REST API for Bukkit/Spigot/Paper Minecraft servers
https://servertap.io
MIT License
233 stars 57 forks source link

Request: Log IP of the requests originated from #261

Open aaira-a opened 1 year ago

aaira-a commented 1 year ago

Is it possible to add IPs to the debug log?

phybros commented 1 year ago

What do you mean? Which log messages?

aaira-a commented 1 year ago

Background: We are using ServerTap on a multiplayer server. More than one clients are calling the v1/server/exec endpoint, with the shared secret.

In example here, if we turn on debug: true in ServerTap config, there is an INFO line logged, showing that the v1/server/exec endpoint was called.

Actual log in my console: 31.10 03:32:18 [Server] INFO /v1/server/exec. My question is whether it is possible to add the caller's IP to this line for tracing the source.

Another extension to this is to actually log the request body of the request itself for security/audit purposes, but I feel that logging IP should be enough for now.

MeesJ commented 6 months ago

If this is added, the X-Forwarded-For header should be supported for this to avoid the logs only returning the IP address of the reverse proxy sitting in front of ServerTap (if any).