IntelliJ IDEA 2024.3 Help

Logs

When running your application, you can view the associated local log files in separate tabs of the Run or Debug tool window. For IntelliJ IDEA to identify which logs to show, you need to specify them in the respective run/debug configuration.

Log settings

Depending on the run/debug configuration type, you can access logs by clicking the Modify options button or opening the Logs tab. If there is neither, it means that the selected run/debug configuration type doesn't support logs.

The 'Modify options' button in the 'Run/Debug Configurations' dialog
The 'Logs' tab in the 'Run/Debug Configurations' dialog
No 'Modify options' button or 'Logs' tab in the 'Run/Debug Configurations' dialog

Add a log

  1. In the run/debug configuration that will be used for launching the app, add or navigate to the Specify logs to be shown in the console option.

  2. In the table, click Add.

  3. Specify the log Alias (the name that will be displayed in the tool window tabs) and the path to the log file.

    You can also specify an Ant pattern for the log path. In case several files of a rolling log match the pattern, the most recent one will be taken. If you want to track all the logs that match the pattern, select Show all files coverable by pattern.

  4. Specify whether the corresponding tab should only show the new log entries using the Skip Content option.

When you have set up a log in the Logs section, the log will open in a separate tab of the Run or Debug tool window whenever you run or debug the application. If you want to temporarily disable the log, you can do so by clearing the Is Active box.

Save console output to a file

If you use console output for logging, you can save it to a file for later inspection.

  1. In the run/debug configuration that will be used for launching the app, add or navigate to the Save console output to file option.

  2. Specify the path to the file. If the file does not exist, it will be created automatically upon the first write.

For a hands-on example, refer to Save console output to a file.

Logger links are marked with a dotted underline:

Grey dotted underline in console indicates a link to a logger

To turn this navigation off, clear the Process terminal output to find class names and highlight them in Settings | Advanced Settings | JVM Languages.

Last modified: 12 November 2024