Hey everyone! I wanted to share my recent journey with Frontail, which has been a game-changer for how I monitor my openHAB logs. If you’re someone who spends a lot of time debugging or just wants a cleaner interface, this might be for you.Earlier this week, I stumbled upon a way to customize Frontail’s themes and color schemes. I’ve always found the default setup a bit lacking, especially when trying to distinguish between different log levels like INFO, WARNING, or ERROR. After some digging, I realized that Frontail’s theming capabilities were more flexible than I initially thought.Here’s what I did:1. Understanding the Basics: Frontail uses JSON files to define how logs are highlighted. These files look for specific strings like [ERROR]
or [DEBUG]
and apply styles to them. However, I noticed that relying solely on hardcoded styles wasn’t the most efficient way to go.2. Modifying the Code: I decided to tweak the app.js
file to add some regular expression support. This allowed me to create more dynamic and flexible rules for highlighting logs. For example, instead of hardcoding [ERROR]
, I could use a regex pattern to catch variations like ERROR:
or ERR
.3. Creating Custom Themes: I then moved on to designing my own themes. I created two versions: a dark theme for easier reading in low-light conditions and a light theme for those who prefer a brighter interface. Each theme includes CSS classes that define colors, fonts, and other styling properties.4. Testing and Refinement: After setting everything up, I tested the themes extensively. It was a bit tricky getting the regex patterns right, but with some trial and error, I managed to get everything working smoothly. The best part? The interface now looks much cleaner, and I can easily spot important logs at a glance.5. Sharing My Work: I thought it would be helpful to share my modified files with the community. You can find them in my fork of the Frontail repository on GitHub. I’ve included detailed instructions on how to install and use the custom themes, so even if you’re not super tech-savvy, you should be able to follow along.If anyone has any questions or suggestions for improving this setup, I’d love to hear them! It’s been a rewarding project, and I’m excited to see how others might build on this idea. Happy logging!