Open wimdeblauwe opened 4 years ago
I think message pattern which is
^(\d{4}\-\d{2}\-\d{2}\s\d{2}:\d{2}:\d{2}\.\d{3})\s+([A-Z]+)\s(\d+)\s\-\-\-\s\[([a-zA-Z\-0-9]+)\]\s([a-zA-Z\.\$\[\]/]+)(.*)$
(replace [([a-zA-Z]+)\]
to [a-zA-Z\-0-9]
)
are more appropriate,for matching log lines like
2020-03-03 09:11:12.162 INFO 27193 --- [http-nio-2333-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 86 ms
2020-07-07 13:01:40.573 INFO 9212 --- [RMI TCP Connection(3)-10.0.75.1] o.s.web.servlet.DispatcherServlet : Completed initialization in 12 ms
For strings like above I'd use:
^(\d{4}\-\d{2}\-\d{2}\s\d{2}:\d{2}:\d{2}\.\d{3})\s+([A-Z]+)\s(\d+)\s\-\-\-\s\[([^\]]+)\]\s([a-zA-Z\.\$\[\]/]+)(.*)$
(replace [a-zA-Z\-0-9]
with [^\]]
)
Because, as you see, there are too many characters to include in a thread name like 'RMI TCP Connection(3)-10.0.75.1'
2020-07-07 13:01:40.573 INFO 9212 --- [RMI TCP Connection(3)-10.0.75.1] o.s.web.servlet.DispatcherServlet : Completed initialization in 12 ms
For strings like above I'd use:^(\d{4}\-\d{2}\-\d{2}\s\d{2}:\d{2}:\d{2}\.\d{3})\s+([A-Z]+)\s(\d+)\s\-\-\-\s\[([^\]]+)\]\s([a-zA-Z\.\$\[\]/]+)(.*)$
(replace[a-zA-Z\-0-9]
with[^\]]
) Because, as you see, there are too many characters to include in a thread name like 'RMI TCP Connection(3)-10.0.75.1'
I tested this via https://regexr.com/ and it looks correct. But using it in the plugin just doesn't seem to work.
I bet it uses java regexp and it differs from js
Might be interesting to have the default Spring Boot pattern in the plugin. This is what I have found that works:
^(\d{4}\-\d{2}\-\d{2}\s\d{2}:\d{2}:\d{2}\.\d{3})\s+([A-Z]+)\s(\d+)\s\-\-\-\s\[([a-zA-Z]+)\]\s([a-zA-Z\.\$\[\]/]+)(.*)$
^\d
yyyy-MM-dd HH:mm:ss.SSS
I also changed the patterns to this to make it work properly: