Example of a highlighted Neos log file in PHPStorm

Logfile highlighting for Neos CMS & Flow

Categories:

Highlighting in PHPStorm (or IntelliJ IDEA)

PHPStorm already supports several kinds of log file formats for highlighting.

You can extend this list manually to make it easier to spot the important log events when you are debugging your application.

For PHPStorm you have to go into your project settings and select "Editor -> Log Highlighting". There you have to add a new entry with the settings you see in the screen shot:

Configuration for log file highlighting in PHPStorm

You can copy the values also from here:

Message pattern: ^([\d:\-\s]+)\s([\d]+)\s+(\w+)\s+(.+)$
Message start pattern: ^\d
Time format: yy-MM-dd HH:mm:ss SSS
Time capture group: 1
Severity capture group: 2
Category capture group: 0

To make the debug lines a bit lighter on the eye you can add an entry to Patterns with the following values:

Pattern: ^\s*d(ebug)?\s*$
Foreground: #837E86

Additionally set the mode to Highlight line.

Highlighting in the terminal

If you want to easily check the logs via the terminal you can install lnav. Which provides more options than the usual command line editors or tools like tail.

By default lnav also doesn't support the Neos logs, but I wrote a plugin some time ago that adds the capability to color them nicely and to make them more helpful. You can find the plugin and the installation procedure here.

Example of a Neos log file highlighted in lnav