scalaz
scalaz

Reputation: 81

Play 2.4 Global settings

I have global object in the root of app folder. But methods onStart and onStop do not work. What is wrong and how can I fix it ?

import persistence.Persist
import play.api._

object Glabal extends GlobalSettings {
  override def onStart(app: Application) {
    try {
      Persist.createSchema
    } catch {
      case e: Exception => Logger.info("Schema exists", e)
    }
    Logger.info("Application has started")
  }

  override def onStop(app: Application) {
    Logger.info("Application shutdown...")
  }
}

BR!

Upvotes: 0

Views: 314

Answers (1)

gun
gun

Reputation: 1066

it should work exactly, how you did it. But: You do have a "typo": Your object is named "Glabal", instead of "Global".

Upvotes: 1

Related Questions