[jboss-jira] [JBoss JIRA] (WFLY-11627) ExampleDS is requirement for applications that don't mandate it.
Bartosz Baranowski (Jira)
issues at jboss.org
Tue Jan 22 05:35:01 EST 2019
[ https://issues.jboss.org/browse/WFLY-11627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13685784#comment-13685784 ]
Bartosz Baranowski commented on WFLY-11627:
-------------------------------------------
jboss-logging quickstart is simple JSP:
{noformat}
<body>
<%
LoggingExample.logDebug();
LoggingExample.logError();
LoggingExample.logFatal();
LoggingExample.logInfo();
LoggingExample.logTrace();
LoggingExample.logWarn();
%>
Log Messages have been written. Please check your console as well as <i>EAP_HOME</i>/standalone/log for messages.
</body>
{noformat}
{code:title=LoggingExample.java|borderStyle=solid}
public class LoggingExample {
// a JBoss Logging 3 style level (FATAL, ERROR, WARN, INFO, DEBUG, TRACE), or a special level (OFF, ALL).
private static Logger log = Logger.getLogger(LoggingExample.class.getName());
static {
logFatal();
logError();
logWarn();
logInfo();
logDebug();
logTrace();
}
public static void logFatal() {
if (log.isEnabled(Logger.Level.FATAL)) {
log.fatal("THIS IS A FATAL MESSAGE");
}
}
public static void logError() {
if (log.isEnabled(Logger.Level.ERROR)) {
log.error("THIS IS AN ERROR MESSAGE");
}
}
public static void logWarn() {
if (log.isEnabled(Logger.Level.WARN)) {
log.warn("THIS IS A WARNING MESSAGE");
}
}
public static void logInfo() {
if (log.isEnabled(Logger.Level.INFO)) {
log.info("THIS IS AN INFO MESSAGE");
}
}
public static void logDebug() {
if (log.isEnabled(Logger.Level.DEBUG)) {
log.debug("THIS IS A DEBUG MESSAGE");
}
}
public static void logTrace() {
if (log.isEnabled(Logger.Level.TRACE)) {
log.trace("THIS IS A TRACE MESSAGE");
}
}
}
{code}
> ExampleDS is requirement for applications that don't mandate it.
> ----------------------------------------------------------------
>
> Key: WFLY-11627
> URL: https://issues.jboss.org/browse/WFLY-11627
> Project: WildFly
> Issue Type: Bug
> Reporter: Bartosz Baranowski
> Assignee: Brian Stansberry
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list