title: How to implement the lifecycle callbacks of play framework(2.5.x)
body: <p>I am trying to learn play framework. I want to implement the lifecycle callbacks of play framework in my application. Now i saw that it can be easily done using <strong>GlobalSettings</strong> below:</p>
  
  <pre><code>object Global extends GlobalSettings {
  
    override def onStart(app: Application) {
      Logger.info("Application has started")
    }  
  
    override def onStop(app: Application) {
      Logger.info("Application shutdown...")
    }  
  
  }
  </code></pre>
  
  <p>But it's been deprecated in the <strong>play framework(2.5.x)</strong>. And they are providing eager binding for <code>onStart</code> callbacks and for <code>onStop</code> and <code>onError</code> there are other mechanisms. I looked into the documentation of release 2.5.x and saw a code there like below:</p>
  
  <pre><code>import com.google.inject.AbstractModule
  import com.google.inject.name.Names
  
  class Module extends AbstractModule {
    def configure() = {
  
      bind(classOf[Hello])
        .annotatedWith(Names.named("en"))
        .to(classOf[EnglishHello]).asEagerSingleton
  
      bind(classOf[Hello])
        .annotatedWith(Names.named("de"))
        .to(classOf[GermanHello]).asEagerSingleton
    }
  }
  </code></pre>
  
  <p>But unfortunately i couldn't understand it. As using GlobalSettings, it was easy enough to implement the lifecycle callbacks. Suppose that i will just implement a Logger info in the lifecycle callbacks. No complex codes.<br> How can i implement this for start, stop and error callbacks in <strong>2.5.x</strong> ??</p>