當前位置: 首頁>>代碼示例>>Java>>正文


Java Logging.getLogger方法代碼示例

本文整理匯總了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();
}
 
開發者ID:gerard-bisama,項目名稱:DHIS2-fhir-lab-app,代碼行數:37,代碼來源:MediatorMain.java

示例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());
}
 
開發者ID:ironfish,項目名稱:oreilly-reactive-with-akka,代碼行數:13,代碼來源:CoffeeHouseApp.java

示例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));
}
 
開發者ID:ironfish,項目名稱:oreilly-reactive-with-akka,代碼行數:12,代碼來源:CoffeeHouseApp.java

示例4: CoffeeHouseApp

import akka.event.Logging; //導入方法依賴的package包/類
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
開發者ID:ironfish,項目名稱:oreilly-reactive-with-akka,代碼行數:6,代碼來源:CoffeeHouseApp.java


注:本文中的akka.event.Logging.getLogger方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。