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, ...
🌐
Oracle
docs.oracle.com › javase › 8 › docs › technotes › guides › deploy › console_trace_log.html
22 Java Console, Tracing, and Logging
April 21, 2026 - This topic describes the Java Console, a debugging aid that redirects any System.out and System.err to the console window. The console is available for applets running with Java Plug-in and applications running with Java Web Start.
🌐
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
🌐
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.
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
🌐
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
🌐
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 ...
🌐
DigitalOcean
digitalocean.com › community › tutorials › logger-in-java-logging-example
Java Logger: Logging Examples with Log4j & SLF4J | DigitalOcean
August 3, 2022 - Implement logging in Java with Logger, Log4j, and SLF4J. Complete guide covering configuration, log levels, best practices, and real-world examples.
Find elsewhere
🌐
Loggly
loggly.com › home › java logging basics
Java Logging Basics - The Ultimate Guide To Logging - Loggly
June 27, 2025 - This section presents Java logging basics, including how to create logs, popular logging frameworks, how to create some of the best log layouts, and how to use appenders to send logs to various destinations, as well as advanced topics like thread context…
🌐
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....
🌐
SigNoz
signoz.io › guides › java logging: from println to production-ready logs
Java Logging: Setup, Log4j2, SLF4J & Monitoring | SigNoz
July 10, 2024 - Learn Java logging with Log4j2, SLF4J, log levels, MDC, JSON logs, async logging, troubleshooting, and monitoring with SigNoz.
🌐
W3Schools
w3schools.com › JSREF › obj_console.asp
Window Console Object
addeventlistener() alert() atob() blur() btoa() clearInterval() clearTimeout() close() closed confirm() console defaultStatus document focus() frameElement frames history getComputedStyle() innerHeight innerWidth length localStorage location matchMedia() moveBy() moveTo() name navigator open() opener outerHeight outerWidth pageXOffset pageYOffset parent print() prompt() removeEventlistener() resizeBy() resizeTo() screen screenLeft screenTop screenX screenY scrollBy() scrollTo() scrollX scrollY sessionStorage self setInterval() setTimeout() status stop() top Window Console · assert() clear() c
🌐
Codecademy
codecademy.com › docs › java › output › .println()
Java | Output | .println() | Codecademy
November 5, 2022 - The following example prints some content to the console. ... Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more! ... Learn to code in Java — a robust programming language used to create software, web and mobile apps, and more.
🌐
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 - In this comprehensive tutorial, we will delve into the realm of best practices for creating a robust logging system specifically tailored for Java applications.
🌐
W3Schools
w3schools.com › java › java_ref_output.asp
Java Output (System.out) Reference
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... The System.out stream, short for "output", is used together with different methods to output values or print text to the console: ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com
🌐
Oracle
java.com › en › download › help › javaconsole.html
How do I enable and view the Java Console?
The Java Console provides information about the Java version, user home directory, and any error message that occurs while running an applet or application.
🌐
Sentry
blog.sentry.io › a-guide-to-logging-and-debugging-in-java
Logging & Debugging in Java - Guide | Sentry Blog
September 25, 2025 - Unsaved console logs disappear when the program stops, making it difficult to keep a history of what happened. They also don’t allow you to categorize messages by severity, which makes it hard to spot critical issues in the output. Basic logging in Java can be achieved using the built-in java.util.logging package.
🌐
CrowdStrike
crowdstrike.com › en-us › guides › java-logging
Java Logging Guide: The Basics
September 19, 2024 - In this overview, we introduce the basic logging concepts for Java applications as well as available logging frameworks and their supported configurations.