Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

teamon/play-airbrake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airbrake.io notifier for Play 2.0

Instalation

Add play-airbrake to your project/Build.scala file

val appDependencies = Seq(
  "eu.teamon" %% "play-airbrake" % "0.3.0"
)

val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
  resolvers += "teamon.eu repo" at "http://repo.teamon.eu"
)

Your app/Global.scala should look like this

import play.api._
import play.api.mvc._
import play.airbrake.Airbrake

object Global extends GlobalSettings {

  override def onError(request: RequestHeader, ex: Throwable) = {
    Airbrake.notify(request, ex)
    super.onError(request, ex)
  }

}

For javascript notifications (not free plan)

<head>
  @Html(play.airbrake.Airbrake.js)
</head>

For java integration your app/Global.java should look like this

class Global extends GlobalSettings {
  @Override
  public Result onError(RequestHeader request, Throwable t) {
    Airbrake.notify(request, t);
    return super.onError(request, t);
  }
}

Configuration

Key Description
airbrake.apiKey String, required airbrake project api key
airbrake.ssl Boolean, optional, defaults to false set to true if you have airbrake plan with SSL support
airbrake.enabled Boolean, optional, defaults to Play.isProd optionally enable/disable notifications for different environment
airbrake.endpoint String, optional, defaults to api.airbrake.io/notifier_api/v2/notices point notifier to you custom airbrake compatible service (e.g. errbit)

About

**NOT MAINTAINED** Airbrake.io notifier for Play 2.0

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages