You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PatternLayout enable the usage of %[ field. It apply a color theme to subsequent logged text based on the log level
It's nice, but would it be possible to explicitly specify the required color ?
For example, using something like %[{yellow}
It would enable having a stable color scheme for certain parts of the logged lines, such as in %[{yellow}%c%] where the category would always be displayed in yellow, making it extra easy to spot.
I personally prefer having :
only the displayed log level part of my logs having a dynamic color theme, based on log level
certain key parts of the logged informations applied a static color theme
other part applied a default color theme
With the current version of log4js I'm using (v6.7.0), I can't achieve the second point.
The best I can do so far is something like this : %]%r %[%p%] %c %m
With the currently proposed enhancement, it would be possible to write : %[{blue}%r %[%p %[{yellow}%c %]%m
which, FMPOV, would make logs reading much easier
The text was updated successfully, but these errors were encountered:
Mumeii
changed the title
Enable specifying the color whenever using %[ filed in a patter
Enable specifying the color whenever using %[ filed in a pattern
Nov 11, 2022
Mumeii
changed the title
Enable specifying the color whenever using %[ filed in a pattern
Enable specifying the color whenever using "%[" in a pattern
Nov 11, 2022
Mumeii
changed the title
Enable specifying the color whenever using "%[" in a pattern
Enable specifying a style whenever using "%[" in a pattern
Nov 14, 2022
Hi
PatternLayout enable the usage of
%[
field. It apply a color theme to subsequent logged text based on the log levelIt's nice, but would it be possible to explicitly specify the required color ?
For example, using something like
%[{yellow}
It would enable having a stable color scheme for certain parts of the logged lines, such as in
%[{yellow}%c%]
where the category would always be displayed in yellow, making it extra easy to spot.I personally prefer having :
With the current version of log4js I'm using (v6.7.0), I can't achieve the second point.
The best I can do so far is something like this :
%]%r %[%p%] %c %m
With the currently proposed enhancement, it would be possible to write :
%[{blue}%r %[%p %[{yellow}%c %]%m
which, FMPOV, would make logs reading much easier
The text was updated successfully, but these errors were encountered: