Message pattern: `^\[(.*)\] (.+?)\.([A-Z]+): (.*)`
Message start pattern: `^\[`
Time format: `yyyy-MM-dd HH:mm:ss`
Time capture group: `1`
Severity capture group: `3`
Category capture group: `2`
Last active
January 7, 2025 12:04
-
-
Save JBlond/4c4ef47a4b2f3eb28c9b96948b581550 to your computer and use it in GitHub Desktop.
PHP Storm IDE monlog pattern
- PHPStorm
- Installed and running Ideolog plugin
- Go to Settings -> Editor -> Log highlighting (Ideolog).
- Add new Log format (plus sign on the right of the top list).
- Put a name Symfony or whatever suits You.
- Pick one of log formats that matches your case. There is no issue to add multiple log formats to the Ideolog, just repeat all steps with different log format.
- If your log format is like this:
[2020-03-10 12:00:00] kernel.DEBUG:
, then in the field Message pattern put this regex:^\[(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})]\s+([^.]+)\.([^:]+):\s+(.*)$
. - If your log format is like this:
[2020-03-05T12:57:24.827849+00:00] console.DEBUG:
, then in the field Message pattern put this regex:^\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}\+\d{2}:\d{2}\]\s+([^.]+)\.([^:]+):\s+(.*)$
.
- In the field Message start pattern put this regex:
^\[
. - In the field Time format put this pattern:
yyyy-MM-dd HH:mm:ss
. - In the field Time capture group set number 1.
- In the field Severity capture group set number 3.
- In the field Category capture group set number 2.
- Push OK button. You're almost done!
To make CRITICAL severity to highlight do following steps:
- Go to Settings -> Editor -> Log highlighting (Ideolog).
- Add new Pattern (plus sign on the right of the bottom-left list).
- Enter new pattern:
^\s*c(ritical)?\s*$
- Select newly created pattern on the list and click Edit icon on the right.
- Check Foreground, click on the color field.
- In new dialog window, at the top right corner type red color in hex
#FF0000
and push Enter key. - Click OK button, close settings and You're done!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment