Permalink
Browse files

[split] Allow people to name there scribe handler 'scribe'

  • Loading branch information...
1 parent 134ed9d commit e95920774ef9751ebb71fe813e0eb3f054a9a7ab Ian Ownbey committed Mar 8, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 util-logging/src/main/scala/com/twitter/logging/ScribeHandler.scala
@@ -37,7 +37,8 @@ class ScribeHandler(hostname: String, port: Int, category: String, bufferTime: D
maxMessagesToBuffer: Int, formatter: Formatter, level: Option[Level])
extends Handler(formatter, level) {
// it may be necessary to log errors here if scribe is down:
- val log = Logger.get("scribe")
+ val loggerName = this.getClass.toString
+ val log = Logger.get(loggerName)
var lastTransmission = Time.epoch
var lastConnectAttempt = Time.epoch
@@ -148,7 +149,7 @@ class ScribeHandler(hostname: String, port: Int, category: String, bufferTime: D
}
def publish(record: javalog.LogRecord): Unit = {
- if (record.getLoggerName == "scribe") return
+ if (record.getLoggerName == loggerName) return
publish(getFormatter.format(record).getBytes("UTF-8"))
}

0 comments on commit e959207

Please sign in to comment.