So I have the following scenario (it's a Grails 2.1 app):
- I have a Controller that can be accessed via //localhost:8080/myController
- This controller in turn executes a call to another URL opening a connection using
new URL("https://my.other.url").openConnection() - I want to capture the request so I can log the information
I have a Filter present in my web.xml already which does the job well for controllers mapped in my app. But as soon as a request is fired to an external URL, I don't get anything.
I understand that my filter will only be invoked to URLs inside my app, and that depends on my filter mapping which is fine.
I'm struggling to see how a solution inside the app is actually viable. I'm thinking of using a mixed approach with the DevOps team to capture such outgoing calls from the container and then log them into a separate file.
I guess my questions are:
- Is there a way to do it inside the app itself?
- Is the approach I'm planning a sensible one?
Cheers!