easiest way to add logging support in play framework

In play framework 2.x, what would be the best way to add logging support in each Action method inside a Controller? Writing an extended/subclassed Action or something else?

Answers


You can use ActionBuilder to create a LoggingAction (here's how: http://www.playframework.com/documentation/2.2.x/ScalaActionsComposition).

However, since you said "each Action", I assume you want to log every request. The easiest way is to use a Filter. They've implemented an example LoggingFilter in the docs: http://www.playframework.com/documentation/2.2.0/ScalaHttpFilters


Need Your Help

How to set up and connect development environment for drupal?

drupal-7 server mariadb

We are working on a Drupal based website. At least three people are working on different parts at the same time. Till now all of them worked on the live environment. As things became more complicat...

URLStream and unicode

apache-flex flash actionscript-3 actionscript

I am trying to send info using USLStream from flash client to JAVA server.