Hi Folks,
I need to monitor some log files generated by Java application using log4j2 library. The log file has ANSI color codes in front of the timestamp.
Some examples:
^[[m^[[36m2024-04-15 08:45:54,918 => Debug log
^[[m^[[32m2024-04-15 08:45:54,325 => Info log
^[[m^[[1;31m2024-04-15 08:46:04,408 => Error log
As you can see from the examples above, different log type will produce different ANSI color code prefix and the length is not consistent.
In this case, how do I specify the log timestamp format?
I need to monitor some log files generated by Java application using log4j2 library. The log file has ANSI color codes in front of the timestamp.
Some examples:
^[[m^[[36m2024-04-15 08:45:54,918 => Debug log
^[[m^[[32m2024-04-15 08:45:54,325 => Info log
^[[m^[[1;31m2024-04-15 08:46:04,408 => Error log
As you can see from the examples above, different log type will produce different ANSI color code prefix and the length is not consistent.
In this case, how do I specify the log timestamp format?
Comment