Does anyone know if it is possible to log in WSO2's audit.log the user's IP address? What's the format I have to configure in repository/conf/log4j2.properties? It works just fine in http_access*.log but I am unable to set it in audit.log
Asked
Active
Viewed 175 times
1 Answers
0
Try adding the below to the deployment.toml
[audit.log.contextual_param]
params = ["remote_address"]
Besides the remote_address
you can also add user_agent
as a parameter or both at the same time.

ycr
- 12,828
- 2
- 25
- 45
-
It is logging the "remote address" but not what I need, the "X-Forwarded-For" – StefanG Sep 30 '22 at 21:31
-
@StefanG AFAIK that's the best you can get. – ycr Sep 30 '22 at 21:48
-
YES! It is working! It requires the correct RemoteIpValve configuration in catalina-server.xml – StefanG Oct 01 '22 at 14:28
-
1In our case we had to add manually the configuration
remote_address user_agent