MongoDB captures public IP in log, any way to capture private IP in log?

[initandlisten] connection accepted from #48 (2 connections now open)it capture 
public ip in log

anyways to capture private ip in log
eg: [initandlisten] connection accepted from #48 (2 connections now open)


The mongod server only reports the client’s IP address depending on which interface it binds to in the server. It cannot know anything about any client that the client doesn’t present to the server.

If you want to capture the private IP of the client, the mongod server first needs to bind to a local IP address (e.g. However this would also make the server only accessible from that private network, which is something that you may or may not want.

Best regards,