本文整理匯總了Java中akka.event.Logging.getLogger方法的典型用法代碼示例。如果您正苦於以下問題:Java Logging.getLogger方法的具體用法?Java Logging.getLogger怎麽用?Java Logging.getLogger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類akka.event.Logging
的用法示例。
在下文中一共展示了Logging.getLogger方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import akka.event.Logging; //導入方法依賴的package包/類
public static void main(String... args) throws Exception {
//setup actor system
final ActorSystem system = ActorSystem.create("mediator");
//setup logger for main
final LoggingAdapter log = Logging.getLogger(system, "main");
//setup actors
log.info("Initializing mediator actors...");
String configPath = null;
if (args.length==2 && args[0].equals("--conf")) {
configPath = args[1];
log.info("Loading mediator configuration from '" + configPath + "'...");
} else {
log.info("No configuration specified. Using default properties...");
}
MediatorConfig config = loadConfig(configPath);
final MediatorServer server = new MediatorServer(system, config);
//setup shutdown hook
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
log.info("Shutting down mediator");
server.stop();
system.shutdown();
}
});
log.info("Starting mediator server...");
server.start();
log.info(String.format("%s listening on %s:%s", config.getName(), config.getServerHost(), config.getServerPort()));
Thread.currentThread().join();
}
示例2: CoffeeHouseApp
import akka.event.Logging; //導入方法依賴的package包/類
public CoffeeHouseApp(final ActorSystem system) {
this.system = system;
log = Logging.getLogger(system, getClass().getName());
coffeeHouse = createCoffeeHouse();
//===========================================================================
// ANSWER
//===========================================================================\
// @todo send "Brew Coffee" to coffeeHouse
// @todo use ActorRef.noSender() as the sender
// coffeeHouse.tell("Brew Coffee", ActorRef.noSender());
}
示例3: CoffeeHouseApp
import akka.event.Logging; //導入方法依賴的package包/類
public CoffeeHouseApp(final ActorSystem system) {
this.system = system;
log = Logging.getLogger(system, getClass().getName());
coffeeHouse = createCoffeeHouse();
//===========================================================================
// ANSWER
//===========================================================================
// @todo implement access to anonymous actor
// system.actorOf(printerProps(coffeeHouse));
}
示例4: CoffeeHouseApp
import akka.event.Logging; //導入方法依賴的package包/類
public CoffeeHouseApp(final ActorSystem system) {
this.system = system;
log = Logging.getLogger(system, getClass().getName());
coffeeHouse = createCoffeeHouse();
}