- Download latest binary for your OS from releases
- Place the executable in your system PATH and ensure it has runing priviliges
Add mcv
or mcv.exe
into the pipeline that outputs the monolog logs. Some examples:
cat monolog.log | grep 'user deleted' | mcv
- for searching a specific entrytail -f monolog.log | mcv
- for live preview of a filedocker logs php-nginx -f | mcv.exe
- for a live preview of docker logs
The following parameters are supported
Param | Description | Default |
---|---|---|
-t | Name of the template to use | normal |
-i | Template body to be used instead of predefined ones. See Templates for more. |
As well as the following flags
Flag | Description |
---|---|
-T | List all templates available to use |
-c | Disable colors in the output |
-f | Show ==> file.name <== lines from tail command |
-n | Don't add empty lines between entries |
-p | Show only parsed lines. Doesn't affect -f |
-test | Run the config against a predefined data-set |
The application uses GoLang textTemplates with all fields from incoming monolog JSON available at root level, and traversable by dot-notation, and starting with a .
(dot). Example: {{.message}}
, and {{.channel}}
. See Additional Fields for more.
Whenever a field in the tamplete will contain some sub-values (i.e. {{._context}}
) it will display a map (map[id:123]
). The full path of {{._context.id}}
will just display the value 123
.
When the requested path will not be present at all, it will display <no value>
Additional fields are added to the values from monolog to be available in the template. They are:
_colors
- colors and text formatting options. This value contains the following sub-values:red
,green
,yellow
,blue
,purple
,cyan
,white
for colorsbold
,underline
,strike
,italic
for formattingreset
- for resetting the text output back to normal
_color
- one of the available colors based on monolog log level- DEBUG - white
- INFO - cyan
- NOTICE - green
- WARNING - yellow
- ERROR - purple
- CRITICAL - red
- ALERT - red
- EMERGENCY - red
_colorR
- alias for_colors.reset
_level
- string representation of the int values in monologlevel
_dateTime
- aY-m-d H:i:s
formatted value passed intimestamp
ordatetime
fields of the monolog JSON_context
and_extra
- string representations of the JSON object passed incontext
andextra
monolog fields_contextPretty
and_extraPretty
pretty-formatted versions of the fields
MCV parses each line of the incoming data and tries to display it using a provided template.
As of now the JSON and Line formatters are supported with their default config and default message structure.
When the received line is not a proper monolog entry in any accepted form, it is displayed as is, in raw value. Unless the -p
flag has been provided.
As the program is designed to be used in pipeline it also recognizes the file name line from tail
. It is ignored by default.