Skip to content

Commit

Permalink
robey
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanking committed Jun 22, 2011
1 parent 917e54d commit 39bb2b4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
11 changes: 6 additions & 5 deletions config/development.scala
Expand Up @@ -22,10 +22,11 @@ new SnowflakeConfig {
val flushQueueLimit = 100000
}

val loggerConfig = new LoggerConfig {
handlers = new FileHandlerConfig {
filename = "snowflake.log"
level = Level.TRACE
}
loggers = new LoggerConfig {
level = Level.DEBUG
handlers = new FileHandlerConfig {
level = Level.TRACE
filename = "snowflake.log"
}
}
}
10 changes: 10 additions & 0 deletions config/development2.scala
@@ -1,4 +1,6 @@
import com.twitter.service.snowflake.{SnowflakeConfig, ReporterConfig}
import com.twitter.logging.config.{LoggerConfig, FileHandlerConfig}
import com.twitter.logging.Logger

new SnowflakeConfig {
val serverPort = 7610
Expand All @@ -19,4 +21,12 @@ new SnowflakeConfig {
val scribeSocketTimeout = 5000
val flushQueueLimit = 100000
}

loggers = new LoggerConfig {
handlers = new FileHandlerConfig {
filename = "snowflake2.log"
level = Logger.TRACE
}
}

}
Expand Up @@ -44,8 +44,6 @@ trait SnowflakeConfig extends ServerConfig[SnowflakeServer] {

val reporterConfig: ReporterConfig

val loggerConfig: LoggerConfig

def apply(runtime: RuntimeEnvironment) = {
new SnowflakeServer(this)
}
Expand All @@ -55,9 +53,7 @@ case class Peer(hostname: String, port: Int)

object SnowflakeServer {
def main(args: Array[String]) {
val runtime = new RuntimeEnvironment(this)
runtime.parseArgs(args.toList)

val runtime = RuntimeEnvironment(this, args)
val server = runtime.loadRuntimeConfig[SnowflakeServer]()
try {
server.start
Expand All @@ -71,7 +67,6 @@ object SnowflakeServer {
}

class SnowflakeServer(config: SnowflakeConfig) extends Service {
Logger.configure(List(config.loggerConfig))
private val log = Logger.get

var server: TServer = null
Expand Down

0 comments on commit 39bb2b4

Please sign in to comment.