Skip to content

Log format

Jiří Škoda edited this page Apr 4, 2024 · 10 revisions

Log format is string containing special characters to describe format of log.

Content
1. General syntax
2. Data symbols
3. Format symbols
3.1 Color symbols
3.2 Style symbols
3.2 Reset symbol

General syntax

Syntax of log format string is based on general PHP-Movic syntax:
%X%
Where X can be any of data symbol, format symbol or reset symbol.

Symbols in format string can be repeated. For example:
%X% [%Y%]: %Z%
Until all of X, Yand Z are valid symbols, log format string is valid too.

Data symbols

Data symbols contains some information connected with log. List of symbols is following:

  • DATE: Represents date and time of log creation formatted according to the configuration
  • LEVEL: Represents level of log
  • PDLVL: Represents level of log padded to the length of longest level (all levels will have same length)
  • MESSAGE: Represents message of log

Format symbols

Format symbols affects appearance of logs. This is mostly designed for logging to standard output. If you want to format only standard output, look at configuration wiki page.

Color symbols

Color symbols enables coloring of output. General syntax is following:
%CB[<COLOR>]% for background color, or
%CF[<COLOR>]% for foreground color.
Where <COLOR> can be any of following: BLACK, GRAY, WHITE, RED, GREEN, BLUE, CYAN, MAGENTAor YELLOW.

Style symbols

Style symbols can change style of output. This feature is not supported everywhere, so it may not appear in output.
Style symbols uses general syntax:
%<STYLE>%, where <STYLE> can be anything from list below:

  • B for bold text
  • I for italic text
  • U for underlined text

Reset symbol

Reset symbols resets all currently set formatting and sets everything to system defaults.
Syntax: %FR%

Clone this wiki locally