本文整理匯總了Java中ch.qos.logback.classic.Logger.info方法的典型用法代碼示例。如果您正苦於以下問題:Java Logger.info方法的具體用法?Java Logger.info怎麽用?Java Logger.info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ch.qos.logback.classic.Logger
的用法示例。
在下文中一共展示了Logger.info方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testUdpSender
import ch.qos.logback.classic.Logger; //導入方法依賴的package包/類
@Test
public void testUdpSender() throws JoranException, InterruptedException {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
context.reset();
configurator.doConfigure(this.getClass().getClassLoader().getResourceAsStream("logback-syslog-udp.xml"));
Logger logger = context.getLogger("test-udp");
logger.info("test message over udp");
context.stop();
Thread.sleep(100);
final String serverData = serverStream.toString();
assertTrue("Server received: " + serverData, serverData.contains("test message over udp"));
}
示例2: testTcpSender
import ch.qos.logback.classic.Logger; //導入方法依賴的package包/類
@Test
public void testTcpSender() throws JoranException, InterruptedException {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
context.reset();
configurator.doConfigure(this.getClass().getClassLoader().getResourceAsStream("logback-syslog-tcp.xml"));
Logger logger = context.getLogger("test-tcp");
logger.info("test message over tcp");
context.stop();
Thread.sleep(100);
final String serverData = serverStream.toString();
assertTrue("Server received: " + serverData, serverData.contains("test message over tcp"));
}
示例3: testTlsSender
import ch.qos.logback.classic.Logger; //導入方法依賴的package包/類
@Test
public void testTlsSender() throws JoranException, InterruptedException {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
context.reset();
configurator.doConfigure(this.getClass().getClassLoader().getResourceAsStream("logback-syslog-tls.xml"));
Logger logger = context.getLogger("test-tls");
logger.info("test message over tls");
context.stop();
Thread.sleep(100);
final String serverData = serverStream.toString();
assertTrue("Server received: " + serverData, serverData.contains("test message over tls"));
}