---
title: "Syntax highlight for .log files"
description: "Here’s a guide to making the .log files easier to scan in PhpStorm."
canonical_url: "https://codex.republic.se/development/phpstorm/syntax-highlight-for-log-files"
section: "Pages"
---

# Syntax highlight for .log files

Here’s a guide to making the .log files easier to scan in PhpStorm.

---

- Go to **Preferences** &gt; **Editor** &gt; **Log Highlighting**
- Add new **Log format**
    - Name: Yii
    - Message pattern: `^([\d-: ]+)\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\]\[(.*?)\] (.*)`
    - Message start pattern: `^\d`
    - Time format: `yyyy-MM-dd HH:mm:ss`
    - Time capture group: **1**
    - Severity capture group: **5**
    - Category capture group: **4**
- Add **Patterns**
    - `^\s*e(rror)?\s*$`
    - `^\s*w(arn(ing))?\s*$`
    - `^\s*i(nfo)?\s*$`
    - `^\s*p(rofile.*)?\s*$`
    - `^\s*d(ebug)?\s*$`
    - `^\s*t(race)?\s*$`
- Then add colors you like for each pattern: Select colors and highlight options. Select "Highlight line" for errors and warnings to highlight the whole section instead of only the words.

---

## Resources

 ![](https://www.google.com/s2/favicons?domain=https://github.com/JetBrains/ideolog/issues/31#issuecomment-695219217&sz=128) <https://github.com/JetBrains/ideolog/issues/31#issuecomment-695219217> // 2025-06-12

 ![](https://www.google.com/s2/favicons?domain=https://stackoverflow.com/questions/23057988/file-size-exceeds-configured-limit-2560000-code-insight-features-not-availabl&sz=128) <https://stackoverflow.com/questions/23057988/file-size-exceeds-configured-limit-2560000-code-insight-features-not-availabl> // 2025-06-12
