Skip to content

Instantly share code, notes, and snippets.

@pj
Created October 12, 2014 22:03
Show Gist options
  • Save pj/e67aa2439cdac2b52af5 to your computer and use it in GitHub Desktop.
Save pj/e67aa2439cdac2b52af5 to your computer and use it in GitHub Desktop.
Setting up Couchbase logging when using Reactive couchbase plugin for play framework.
// Seems like this has to be run before the plugin is loaded by play, so stick it in the beforeStart method
object Global extends GlobalSettings {
override def beforeStart(app: Application) {
val systemProperties = System.getProperties();
systemProperties.put("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.SunLogger");
System.setProperties(systemProperties)
SunLogger.getLogger("net.spy.memcached").setLevel(SunLevel.SEVERE)
SunLogger.getLogger("com.couchbase.client").setLevel(SunLevel.SEVERE)
SunLogger.getLogger("com.couchbase.client").getParent.getHandlers.foreach {
handler => handler.setLevel(SunLevel.SEVERE)
}
}
}
@chenbekor
Copy link

the above does not compile - can you please provide an update version or at least provide the exact imports? I'm using ReactiveCouchbase 0.3 with Play 2.3.6

10x!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment