What is Gradle's default log level when you run a build, and what kind of output does it show?
answer
- ERROR < QUIET < WARNING < LIFECYCLE < INFO < DEBUG
- default = LIFECYCLE
- shows that level + everything below it
- println maps to QUIET
- last level flag wins
basics
~10 sThe default level is LIFECYCLE. It shows task execution progress, the BUILD SUCCESSFUL/FAILED line, and user-facing messages — but hides INFO and DEBUG detail to keep output concise.
solid answer
~40 sBy default Gradle logs at the **LIFECYCLE** level. This is the level meant for normal day-to-day use: it surfaces the high-level story of the build — which tasks run, deprecation/warning summaries, the progress bar, and the final `BUILD SUCCESSFUL`/`BUILD FAILED` result — without drowning you in detail. Gradle's log levels, from least to most verbose, are **ERROR < QUIET < WARNING < LIFECYCLE < INFO < DEBUG**. At LIFECYCLE you implicitly get everything at or below it (errors, quiet, warnings) plus lifecycle messages, but not INFO or DEBUG. You raise verbosity with `-i`/`--info` or `-d`/`--debug`, or lower it with `-q`/`--quiet`. Importantly, `System.out.println` from build logic is captured and shown at QUIET, so it always appears even at the default level.
code
bash · 2 linesgradle build # LIFECYCLE (default): task progress + BUILD SUCCESSFUL
gradle build -i # INFO: also shows up-to-date / skipped reasonsgo deeper
Know that LIFECYCLE is the default and shows task progress plus the build result.
Recite the full ordering and explain that a level shows itself plus everything below it in verbosity.
Explain the println-to-QUIET mapping and that only one level is active, last-flag-wins.
Frame default verbosity as a UX trade-off and connect it to console mode and CI log-noise policy across the org.
## Gradle's log levels Gradle has a fixed set of log levels. From the **least verbose** (shows the least) to the **most verbose** (shows the most): - **ERROR** — error messages only. - **QUIET** — important information messages. This is where `println` / `System.out` from build scripts lands. - **WARNING** — warning messages (e.g. deprecations summary). - **LIFECYCLE** — progress information; the **default**. Task headers, the progress bar, and the build result. - **INFO** — informational messages: which tasks were skipped/up-to-date and *why*, input/output snapshotting hints, dependency resolution notes. - **DEBUG** — everything, including internal Gradle machinery, full dependency resolution, and timestamps on every line. When you select a level, you see messages **at that level and every level below it** in verbosity. So LIFECYCLE shows ERROR, QUIET, WARNING and LIFECYCLE messages, but suppresses INFO and DEBUG. ## Why LIFECYCLE is the default LIFECYCLE is the sweet spot for interactive use: you see the **what** (tasks executing, result) without the **why/how** (cache decisions, internal resolution). It keeps the console readable while still telling you whether the build passed. ## Selecting a level on the CLI ```bash gradle build # LIFECYCLE (default) gradle build -q # QUIET — almost silent gradle build -i # INFO — task up-to-date reasons, etc. gradle build -d # DEBUG — everything + timestamps ``` Only **one** log level is active at a time. If you pass several, the **last one wins** (e.g. `-i -q` resolves to QUIET). ## A common gotcha Because `println` output is mapped to **QUIET**, it shows even at the default LIFECYCLE level and even under `-q`. That's deliberate: build authors who `println` expect to always see it. To emit at a chosen level instead, use the `Logger` API (`logger.info(...)`, `logger.lifecycle(...)`).
- Order Gradle's log levels from least to most verbose.ERROR, QUIET, WARNING, LIFECYCLE, INFO, DEBUG.
- If you pass both -i and -q, which level applies?QUIET — when multiple log-level flags are passed, the last one on the command line wins.
saying these in an interview costs you the question
- Claiming the default level is INFO or DEBUG — it is LIFECYCLE.
- Saying println from a build script is hidden at default — it maps to QUIET and is always shown.