Colorize Spring Boot Logs in Sublime Text with the ANSIescape Plugin
This guide explains how to install and use the ANSIescape plugin in Sublime Text to render Spring Boot console logs with proper colors, eliminating unreadable ANSI escape codes and providing step‑by‑step instructions, troubleshooting tips, and ways to revert to plain logs.
Introduction
Spring Boot console logs include ANSI color codes that help differentiate log levels, but when opened in Sublime Text they appear as garbled characters such as [31m and [0;39m. Installing the ANSIescape plugin allows Sublime Text to interpret and display these colors correctly.
Preview
Before and after screenshots illustrate how the log looks without the plugin versus with colorized output.
Prerequisites
Make sure Sublime Text and Package Control are installed. If Package Control is missing, install it by opening the console ( Ctrl+ on Windows/Linux, Cmd+ on macOS), visiting the official installation page, copying the provided code, pasting it into the console, and restarting Sublime Text.
Install ANSIescape Plugin
1. Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) to open the command palette. 2. Type Install Package and press Enter. 3. Type ANSIescape, select it from the list, and install.
Enable Colorized Logs
Open your Spring Boot .log file in Sublime Text.
Press Ctrl+Shift+P, type ANSI, and choose ANSIescape: Colorize. The log colors are rendered instantly, matching terminal output.
How to Revert to Plain Logs
Method 1: Close and Reopen
Close the file and reopen it with Sublime Text; the original ANSI codes become visible again.
Method 2: Undo
Press Ctrl+Z (or Cmd+Z) to undo the ANSIescape: Colorize command.
Method 3: Uninstall Plugin
Press Ctrl+Shift+P (or Cmd+Shift+P), type Remove Package, press Enter.
Select ANSIescape and confirm removal.
Common Issues
Plugin Not Found
Ensure Package Control is correctly installed and that you can access packagecontrol.io.
No Color Change
Verify the log file actually contains ANSI escape sequences (e.g., [31m) and that you have executed ANSIescape: Colorize.
Disable Colors in Future Logs
Add the following line to application.properties to stop Spring Boot from emitting ANSI codes:
spring.output.ansi.enabled=neverSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Selected Java Interview Questions
A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
