本文整理匯總了Java中org.jboss.logging.Logger.error方法的典型用法代碼示例。如果您正苦於以下問題:Java Logger.error方法的具體用法?Java Logger.error怎麽用?Java Logger.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.logging.Logger
的用法示例。
在下文中一共展示了Logger.error方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: resolveEntity
import org.jboss.logging.Logger; //導入方法依賴的package包/類
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException {
for (int i = 0; i < Constants.CACHED_DTD_PUBLIC_IDS.length; i++) {
String cachedDtdPublicId = Constants.CACHED_DTD_PUBLIC_IDS[i];
if (cachedDtdPublicId.equals(publicId)) {
String resourcePath = Constants.CACHED_DTD_RESOURCE_PATHS[i];
InputStream input = this.getClass().getResourceAsStream(
resourcePath);
if (input == null) {
throw new SAXException(Localizer.getMessage(
"jsp.error.internal.filenotfound", resourcePath));
}
InputSource isrc = new InputSource(input);
return isrc;
}
}
Logger log = Logger.getLogger(MyEntityResolver.class);
if (log.isDebugEnabled())
log.debug("Resolve entity failed" + publicId + " " + systemId);
log.error(Localizer.getMessage("jsp.error.parse.xml.invalidPublicId",
publicId));
return null;
}
示例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");
}