14:27:32.027 [http-8081-1] ERROR com.xxx.demo.WebController[dashboard,40] - @module=module1 @action=action1 @operator=operator1 @result=result1 @host=172.16.5.21 @msg=msg1
上述一行日志,格式固定,“@module=”,“@action=”等都是固定的,module1 这些值是动态的,其中有可能有空格。
需要解析出(得到):
时间:14:27:32.027
类名:WebController
方法名:dashboard
@module的值:module1
...
@msg的值:msg1
哪位大神有什么好办法,或者解析出其中的几个字段都可以(无法解析的就字符串操作);
因为是大量日志,所以字符串split这种操作怕性能有问题;
提前感谢