RequestLogger in play-ws

40 views
Skip to first unread message

Ömer Karahan

unread,
Nov 11, 2017, 11:57:08 AM11/11/17
to Play framework dev
Hi guys,

I am new to this mailing list. I have one feature proposal or improvement proposal. In our company we use the play framework and we want to log outgoing requests. There is a AhcCurlRequestLogger in the play-ws project. See here: https://github.com/playframework/play-ws/blob/master/play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/AhcCurlRequestLogger.scala

I don't like this approach since it looks a bit experimental for me. I would like to make a proposal for outgoing requests with a request logger. I don't thought it through but in my mind I have the following:

- The request logger should not only work with AhcRequests
- Logging of the body should be configurable
- The authorization header should not be logged
- Nice to have would be to log in json or in curl or in some other format


Looking forward to hear some feedback. I would then implement a proposal and open a pull request.

Best,
Ömer

Dominik Dorn

unread,
Nov 12, 2017, 7:03:01 AM11/12/17
to Ömer Karahan, Play framework dev
Hi Ömer,

as the name implies, the AhcCurlRequestLogger is there to log outgoing requests in a format which can be pasted to a command line. This is mainly a debugging tool, 
used when trying to figure out why certain things are not working as expected. 

If you need to log outgoing requests for auditing purposes, just create your own request logger. you can use the source of the AhcCurlRequestLogger as a starting point.

Cheers,
Dominik


--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ömer Karahan

unread,
Nov 12, 2017, 7:31:22 AM11/12/17
to Play framework dev
Hi thanks for your reply,

would it make sense to integrate such a general logger in the play-ws project ?

Dominik Dorn

unread,
Nov 12, 2017, 7:46:36 AM11/12/17
to Ömer Karahan, Play framework dev
Depends on how far it is tailored to your use case.. I would say, try to implement it first in your app, then generalise and send a Pull Request!

Cheers,
Dominik

--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ömer Karahan

unread,
Nov 12, 2017, 10:45:04 AM11/12/17
to Play framework dev
Ok cool. Will do it.

Best,
Ömer
Reply all
Reply to author
Forward
0 new messages