Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update Play.configuration programmatically in Play 2.0?

In Play 1, I could write a class that extends PlayPlugin and do something like this:

@Override
public void onConfigurationRead() {
  Play.configuration.put("logger.application","DEBUG");
}

I don't see how to do the equivalent in Play 2. The Plugin interface no longer has the "on ConfigurationRead" method. I'm not sure if it's safe to do this in onApplicationStart, and even if it was, I'm not seeing how to modify the Play.configuration object in Scala.

like image 208
Jennifer Hickey Avatar asked Dec 23 '11 22:12

Jennifer Hickey


1 Answers

What you're seeking for seems now to be located in GlobalSettings, here is the wiki page

Extending it, you'll be able to change the configuration or whatever global settings you want to override (Bad Requests redirect or message for instance.)

like image 178
Andy Petrella Avatar answered Jan 04 '23 12:01

Andy Petrella