本文整理汇总了Java中org.jboss.logging.Logger.debug方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.debug方法的具体用法?Java Logger.debug怎么用?Java Logger.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.logging.Logger
的用法示例。
在下文中一共展示了Logger.debug方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: testNothing
import org.jboss.logging.Logger; //导入方法依赖的package包/类
@Test
public void testNothing() {
Logger gouda = Logger.getLogger( "cheese.gouda" );
gouda.info( "gouda info" );
gouda.debug( "gouda debug");
assertTrue( gouda.isTraceEnabled() );
assertTrue( gouda.isDebugEnabled() );
assertTrue( gouda.isInfoEnabled() );
Logger cheddar = Logger.getLogger( "cheese.cheddar" );
cheddar.info( "cheddar info" );
cheddar.debug( "cheddar debug" );
assertFalse( cheddar.isTraceEnabled() );
assertFalse( cheddar.isDebugEnabled() );
assertFalse( cheddar.isInfoEnabled() );
}
示例3: testNothing
import org.jboss.logging.Logger; //导入方法依赖的package包/类
@Test
public void testNothing() {
Logger gouda = Logger.getLogger( "cheese.gouda" );
gouda.info( "gouda info" );
gouda.debug( "gouda debug");
assertFalse( gouda.isTraceEnabled() );
assertFalse( gouda.isDebugEnabled() );
assertTrue( gouda.isInfoEnabled() );
Logger cheddar = Logger.getLogger( "cheese.cheddar" );
cheddar.info( "cheddar info" );
cheddar.debug( "cheddar debug" );
assertFalse( cheddar.isTraceEnabled() );
assertFalse( cheddar.isDebugEnabled() );
assertTrue( cheddar.isInfoEnabled() );
}
示例4: 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");
}
示例5: 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");
}
示例6: warning
import org.jboss.logging.Logger; //导入方法依赖的package包/类
public void warning(SAXParseException ex) throws SAXException {
Logger log = Logger.getLogger(MyErrorHandler.class);
if (log.isDebugEnabled())
log.debug("ParserUtils: warning ", ex);
// We ignore warnings
}
示例7: onException
import org.jboss.logging.Logger; //导入方法依赖的package包/类
public static Response onException(Exception e, Logger log) {
if (e instanceof IllegalArgumentException) {
return badRequest(e.getMessage());
}
if (null != e.getCause() && e.getCause() instanceof IllegalArgumentException) {
return badRequest(e.getCause().getMessage());
}
if (null != log) {
log.debug(e.getMessage(), e);
}
return internalError(e.getMessage());
}
示例8: testCustomCategory
import org.jboss.logging.Logger; //导入方法依赖的package包/类
@Test
public void testCustomCategory() {
Logger logger = Logger.getLogger("custom.category");
logger.info("gouda info");
logger.debug("gouda debug");
logger.trace("gouda trace");
assertFalse(logger.isTraceEnabled());
assertTrue(logger.isDebugEnabled());
assertTrue(logger.isInfoEnabled());
}
示例9: testCustomCategoryChildren
import org.jboss.logging.Logger; //导入方法依赖的package包/类
@Test
public void testCustomCategoryChildren() {
Logger logger = Logger.getLogger("custom.category.children.Something");
logger.info("gouda info");
logger.debug("gouda debug");
logger.trace("gouda trace");
assertFalse(logger.isTraceEnabled());
assertTrue(logger.isDebugEnabled());
assertTrue(logger.isInfoEnabled());
}
示例10: testRoot
import org.jboss.logging.Logger; //导入方法依赖的package包/类
@Test
public void testRoot() {
Logger logger = Logger.getLogger("");
logger.info("gouda info");
logger.debug("gouda debug");
logger.trace("gouda trace");
assertTrue(logger.isTraceEnabled());
assertTrue(logger.isDebugEnabled());
assertTrue(logger.isInfoEnabled());
}
示例11: loadProperties
import org.jboss.logging.Logger; //导入方法依赖的package包/类
/**
* Utility method which loads the given properties file and returns a
* Properties object containing the key,value pairs in that file. The
* properties files should be in the class path as this method looks to the
* thread context class loader (TCL) to locate the resource. If the TCL is a
* URLClassLoader the findResource(String) method is first tried. If this
* fails or the TCL is not a URLClassLoader getResource(String) is tried. If
* not, an absolute path is tried.
*
* @param propertiesName
* - the name of the properties file resource
* @param log
* - the logger used for trace level messages
* @return the loaded properties file if found
* @exception java.io.IOException
* thrown if the properties file cannot be found or loaded
*/
static Properties loadProperties(String propertiesName, Logger log) throws IOException {
ClassLoader loader = ResourceActions.getContextClassLoader();
URL url = null;
// First check for local visibility via a URLClassLoader.findResource
if (loader instanceof URLClassLoader) {
URLClassLoader ucl = (URLClassLoader) loader;
url = ResourceActions.findResource(ucl, propertiesName);
log.trace("findResource: " + url); //$NON-NLS-1$
}
if (url == null)
url = loader.getResource(propertiesName);
if (url == null) {
url = new URL(propertiesName);
}
log.trace("Properties file=" + url); //$NON-NLS-1$
Properties bundle = new Properties();
InputStream is = null;
try {
is = ResourceActions.openStream(url);
} catch (PrivilegedActionException e) {
throw new IOException(e.getLocalizedMessage());
}
if (is != null) {
bundle.load(is);
is.close();
} else {
throw new IOException("Properties file " + propertiesName + " not available");//$NON-NLS-1$ //$NON-NLS-2$
}
log.debug("Loaded properties, users=" + bundle.keySet());//$NON-NLS-1$
return bundle;
}