Created
October 12, 2014 22:03
-
-
Save pj/e67aa2439cdac2b52af5 to your computer and use it in GitHub Desktop.
Setting up Couchbase logging when using Reactive couchbase plugin for play framework.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!