-
-
Save ashewring/1572427 to your computer and use it in GitHub Desktop.
Revisions
-
momania created this gist
Aug 29, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ package com.acme.logging import akka.actor.Actor import akka.event.EventHandler import akka.event.slf4j.{Logger, Logging} class MySlf4jEventHandler extends Actor with Logging { import EventHandler._ self.id = ID self.dispatcher = EventHandlerDispatcher def receive = { case Error(cause, instance, message) => Logger(instance.getClass).error(message.toString, cause) case Warning(instance, message) => Logger(instance.getClass).warn(message.toString) case Info(instance, message) => Logger(instance.getClass).info(message.toString) case Debug(instance, message) => Logger(instance.getClass).debug(message.toString) case event => log.debug(event.toString) } } } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ akka { event-handlers = ["com.acme.logging.MySlf4jEventHandler"] event-handler-level = "INFO" }