I can’t see console output on project with Wildfly

Asked

Viewed 1,836 times

1

I can’t see any console output on a project with Wildfly 8.0.0.

If at any point in my code I make one System.out.println("Qualquer coisa") Simply nothing appears on my Eclipse Kepler console.

The same project running with Apache Tomcat 7 outputs the console with no problem.

What can it be?

1 answer

2


Application servers are a little more complex, and they use Loggers for that. The default output is not the same as a desktop app, for example. In order to be able to properly see this log you should use something like:

import java.util.logging.Logger;
...

private static final Logger log = Logger.getLogger(SuaClasse.class.getName());

After that it’s simple:

log.info("Mensagem");
log.warning("Mensagem");
log.severe("Mensagem");
log...

You will now have your logs in the IDE console, additionally you can query the log file within the server in the /standalone/log/server folder.log

Hugs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.