JetBrains / ideolog

Interactive viewer for '.log' files.
MIT License
254 stars 55 forks source link

Add default Spring Boot file logging pattern #75

Open wimdeblauwe opened 4 years ago

wimdeblauwe commented 4 years ago

Might be interesting to have the default Spring Boot pattern in the plugin. This is what I have found that works:

I also changed the patterns to this to make it work properly: image

TheColdVoid commented 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

Quipex commented 4 years ago

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'

mathiasbosman commented 3 years ago

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.

Quipex commented 3 years ago

I bet it uses java regexp and it differs from js