ifeilong / feilong-spring

:gem:focus on spring
Apache License 2.0
4 stars 12 forks source link

MonitorMessageEntity 新增 tostring 方法 #197

Closed venusdrogon closed 5 years ago

venusdrogon commented 5 years ago

MonitorMessageEntity 新增 tostring 方法, 方便一些地方的日志输出

22:25:47 INFO  (AbstractHandlerMethodInterceptorAdapter.java:178) postConstruct() - [com.feilong.spring.web.servlet.interceptor.monitor.MonitorInterceptor] field's value map:
[    {
        "afterCompletionInterceptorConditionEntity": null,
        "afterConcurrentHandlingStartedInterceptorConditionEntity": null,
        "isNeedDoAfterCompletion": true,
        "isNeedDoAfterConcurrentHandlingStarted": true,
        "isNeedDoPostHandle": true,
        "isNeedDoPreHandle": true,
        "monitorMessageEntity": "com.feilong.spring.web.servlet.interceptor.monitor.MonitorMessageEntity@5b21d415",
        "postHandleInterceptorConditionEntity": null,
        "preHandleInterceptorConditionEntity": null
    }]
venusdrogon commented 5 years ago

添加

    @Override
    public String toString(){
        return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
    }

效果 :


[    {
        "afterCompletionInterceptorConditionEntity": null,
        "afterConcurrentHandlingStartedInterceptorConditionEntity": null,
        "isNeedDoAfterCompletion": true,
        "isNeedDoAfterConcurrentHandlingStarted": true,
        "isNeedDoPostHandle": true,
        "isNeedDoPreHandle": true,
        "monitorMessageEntity": "com.feilong.spring.web.servlet.interceptor.monitor.MonitorMessageEntity@168a7695[requestLogSwitch=com.feilong.servlet.http.entity.RequestLogSwitch$NormalRequestLogSwitch@340f2af8,isShowRequestAttribute=false,allowFormatClassTypes={},performanceThreshold=2000,isShowPostHandleLog=false,isShowAfterCompletionLog=false,isShowAfterConcurrentHandlingStartedLog=false,sensitiveRequestParamNameList=[username],ignoreRequestParamNames={_}]",
        "postHandleInterceptorConditionEntity": null,
        "preHandleInterceptorConditionEntity": null
    }]