本文整理汇总了Java中org.jboss.logging.Logger.warn方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.warn方法的具体用法?Java Logger.warn怎么用?Java Logger.warn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.logging.Logger
的用法示例。
在下文中一共展示了Logger.warn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: debugFrame
import org.jboss.logging.Logger; //导入方法依赖的package包/类
public static void debugFrame(Logger logger, String message, ByteBuf byteIn) {
if (logger.isTraceEnabled()) {
int location = byteIn.readerIndex();
// debugging
byte[] frame = new byte[byteIn.writerIndex()];
byteIn.readBytes(frame);
try {
logger.trace(message + "\n" + ByteUtil.formatGroup(ByteUtil.bytesToHex(frame), 8, 16));
} catch (Exception e) {
logger.warn(e.getMessage(), e);
}
byteIn.readerIndex(location);
}
}
示例2: main
import org.jboss.logging.Logger; //导入方法依赖的package包/类
public static void main(String[] args) throws MalformedURLException {
// 2. Specify the alternate log manager as a system property
System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
// 3. Specify a system property point to logging.properties(optional, if not set, a configuration locator will find 'logging.properties' in the class path)
String propUrl = JBossLoggingExample.class.getClassLoader().getResource("logging.properties").toString();
System.out.println(propUrl);
System.setProperty("logging.configuration", propUrl);
// 4. Initialize a Logger
Logger logger = Logger.getLogger(JBossLoggingExample.class);
// 5. logging the message
logger.trace("TRACE Message");
logger.debug("DEBUG Message");
logger.info("INFO Message");
logger.warn("WARN Message");
logger.error("Error Message");
logger.fatal("FATAL Message");
}
示例3: main
import org.jboss.logging.Logger; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
// 2. Specify the alternate log manager as a system property
System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
// 3. Configure Programmtically
String logLevel = "TRACE";
String logFile = "target/jboss-logging-programmtically.log";
PropertyConfigurator configurator = new PropertyConfigurator();
configurator.configure(createLogManagerConfig(logLevel, logFile));
// 4. Initialize a Logger
Logger logger = Logger.getLogger(JBossLoggingExample.class);
// 5. logging the message
logger.trace("TRACE Message");
logger.debug("DEBUG Message");
logger.info("INFO Message");
logger.warn("WARN Message");
logger.error("Error Message");
logger.fatal("FATAL Message");
}