How to programmatically update Play.configuration in Play 2.0?

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

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

I don’t see how to make an equivalent in Play 2. The plugin interface no longer has an “on ConfigurationRead” method. I'm not sure how safe it is to do this on onApplicationStart, and even if that were the case, I don’t see how to modify the Play.configuration object in Scala.

+6
source share
1 answer

What you are looking for is now in GlobalSettings , here is the wiki page

By expanding it, you can change the configuration or any global parameters that you want to override (for example, a Bad Requests redirection or message).

+2
source

Source: https://habr.com/ru/post/904420/


All Articles