The Log class:

API for sending log output.

Generally, use the Log.v() Log.d() Log.i() Log.w() and Log.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.

Answer from nhaarman on Stack Overflow
🌐
W3Schools
w3schools.com › jsref › met_console_log.asp
JavaScript console.log() Method
The log() method is useful for testing purposes. When testing console methods, be sure to have the console view visible. Press F12 to open the console veiw. ... If you want to use W3Schools services as an educational institution, team or enterprise, ...
🌐
Delft Stack
delftstack.com › home › howto › java › console log in java
console.log in Java | Delft Stack
March 4, 2025 - This article introduces console.log in Java, exploring various methods for logging messages to the console. Learn how to use System.out.println, Log4j, and SLF4J for effective debugging and logging practices in your Java applications. Discover the best practices and enhance your development ...
🌐
W3Schools
w3schoolsua.github.io › hyperskill › intro-to-logging_en.html
Java Software quality. Introduction to logging. Lessons for beginners. W3Schools in English
Java Introduction to logging. Theory. Log. When, What, and How. Log levels. Log Format. Conclusion. Test tasks and answers. Tutorial from the Hyperskill website. Lessons for beginners. W3Schools in English
🌐
DigitalOcean
digitalocean.com › community › tutorials › logger-in-java-logging-example
Java Logger: Logging Examples with Log4j & SLF4J | DigitalOcean
August 3, 2022 - handlers= java.util.logging.ConsoleHandler .level= FINE # default file output is in user's home directory.
🌐
Vogella
vogella.com › tutorials › Logging › article.html
Java Logging API - Tutorial
Log levels INFO and higher will be automatically written to the console. Each handler’s output can be configured with a formatter ... You can also build your own formatter. The following is an example of a formatter which will create HTML output. package com.vogella.logger; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Formatter; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; // this custom formatter formats parts of a log record to a single line class MyHtmlFormatter extends Formatter { // this metho
Top answer
1 of 4
141

The Log class:

API for sending log output.

Generally, use the Log.v() Log.d() Log.i() Log.w() and Log.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.

2 of 4
25

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
🌐
Loggly
loggly.com › home › java logging basics
Java Logging Basics - The Ultimate Guide To Logging - Loggly
June 27, 2025 - For example, java.util.logging provides two Layouts: the SimpleFormatter and the XMLFormatter. SimpleFormatter, the default Layout for ConsoleHandlers, outputs plain text log entries similar to this:
🌐
Oracle
docs.oracle.com › javase › 8 › docs › technotes › guides › deploy › console_trace_log.html
22 Java Console, Tracing, and Logging
April 21, 2026 - See Section 22.1, "Debugging Options in the Java Console" for information. Another way to set fine-grained tracing is through the Java Control Panel. For example, to enable tracing for everything (option 5 above), enter the following options in the "Java Run Time Parameters" textfield:
Find elsewhere
🌐
W3Schools
w3schools.com › JSREF › obj_console.asp
Window Console Object
The console object is a property of the window object. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
LabEx
labex.io › tutorials › java-how-to-print-output-to-console-in-java-417652
How to print output to console in Java | LabEx
Learn how to print basic and advanced console output in Java programming. Discover techniques to display text, variables, and formatted data in the console.
🌐
SigNoz
signoz.io › guides › java logging: from println to production-ready logs
Java Logging: Setup, Log4j2, SLF4J & Monitoring | SigNoz
July 10, 2024 - The placeholders ({}) are your friends. They defer string creation until the logger knows it actually needs the message. Development teams need verbose output on the console, while production teams need structured files that rotate predictably.
🌐
W3Schools
w3schools.com › jsref › api_console.asp
Console API
The console object is a property of the window object. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
Codecademy
codecademy.com › docs › java › output › .println()
Java | Output | .println() | Codecademy
November 5, 2022 - Learn to code in Java — a robust programming language used to create software, web and mobile apps, and more. Beginner Friendly.Beginner Friendly17 hours17 hours ... The argument will be displayed on the console, followed by a new line. The following example prints some content to the console.
🌐
Better Stack
betterstack.com › community › guides › logging › how-to-start-logging-with-java
10 Best Practices for Logging in Java | Better Stack Community
January 22, 2026 - The framework is actively maintained and has a large user community, making it a reliable choice for logging in Java applications. Overall, If you are looking for something simple and easy to use, you should go with Logback, and you if need a more feature-rich and extensible framework, then you should consider Log4j instead. In this tutorial, we are going to use Log4j as an example, as it is the more popular option.
🌐
Sentry
blog.sentry.io › a-guide-to-logging-and-debugging-in-java
Logging & Debugging in Java - Guide | Sentry Blog
September 25, 2025 - You may have used System.out.println() ... example: public class Main { public static void main(String[] args) { System.out.println("Debugging: Starting the program"); int result = 5 + 3; System.out.println("Debugging: Result is " + result); } } ... This kind ...
🌐
W3Schools
w3schools.com › java › java_output.asp
Java Output Values / Print Text
Booleans Real-Life Example Code Challenge Java If...Else · if else else if Short Hand If...Else Nested If Logical Operators Real-Life Examples Code Challenge Java Switch
🌐
Medium
medium.com › javarevisited › front-end-debugging-part-2-console-log-to-the-max-851d15bb9ae9
Front End Debugging Part 2: Console.log() to the Max | by Shai Almog | Javarevisited | Medium
December 9, 2024 - In my previous post I talked about why Console.log() isn’t the most effective debugging tool. In this installment, we will do a bit of an…
🌐
javaspring
javaspring.net › blog › console-log-java
Mastering Console Logging in Java — javaspring.net
This blog post will delve into the fundamental concepts of console logging in Java, explore various usage methods, discuss common practices, and present best practices to help you use console logging effectively.