To view the Java console, right click on the Java icon in the system tray (assuming you're using Windows) and choose "Open console" - as pictured at the bottom of this page
Answer from George3 on Stack ExchangeTo view the Java console, right click on the Java icon in the system tray (assuming you're using Windows) and choose "Open console" - as pictured at the bottom of this page
- Click Start
- Select Settings
- Select Control Panel.
- Double click the Java icon.
- Click the Advance tab.
- Click on the + sign
- Select Show Console and click Apply.

You need to define a console appender:
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-12d{HH:mm:ss,SSS} - %p - %C{1}.%M(%-3L) | %m%n" />
</layout>
</appender>
And then add it to the root:
<root>
<appender-ref ref="CONSOLE" />
</root>
below i give you an example of a log4j configuration:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- Appenders -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%t] %c (%L) - %m%n" />
</layout>
</appender>
<logger name="com.opensymphony.xwork2">
<level value="error" />
</logger>
<!-- Root Logger -->
<root>
<priority value="info" />
<appender-ref ref="console" />
</root>
</log4j:configuration>
then in the class that you want logging you need to declare the logger like this :
private final static Logger logger = Logger.getLogger(Giannis.class);
and then you do something like
logger.debug("Hello there");
you shoudl see this in the logs when the program is run
It depends how your logging is set up.
In general, it will either be in your server log (for example, for Tomcat, they're in the Tomcat home directory under the logs directory), or in a file that's been configured for the app.
You will need to configure the logging output to write into a file (or the console). You can then tail the file to keep up-to-date.
The Log class:
API for sending log output.
Generally, use the
Log.v()Log.d()Log.i()Log.w()andLog.e()methods.The order in terms of verbosity, from least to most is
ERROR,WARN,INFO,DEBUG,VERBOSE. Verbose should never be compiled into an application except during development. Debug logs are compiled in but stripped at runtime. Error, warning and info logs are always kept.
Outside of Android, System.out.println(String msg) is used.
Use the Android logging utility.
http://developer.android.com/reference/android/util/Log.html
Log has a bunch of static methods for accessing the different log levels. The common thread is that they always accept at least a tag and a log message.
Tags are a way of filtering output in your log messages. You can use them to wade through the thousands of log messages you'll see and find the ones you're specifically looking for.
You use the Log functions in Android by accessing the Log.x objects (where the x method is the log level). For example:
CopyLog.d("MyTagGoesHere", "This is my log message at the debug level here");
Log.e("MyTagGoesHere", "This is my log message at the error level here");
I usually make it a point to make the tag my class name so I know where the log message was generated too. Saves a lot of time later on in the game.
You can see your log messages using the logcat tool for android:
Copyadb logcat
Or by opening the eclipse Logcat view by going to the menu bar
CopyWindow->Show View->Other then select the Android menu and the LogCat view