Giter VIP home page Giter VIP logo

Comments (2)

venusdrogon avatar venusdrogon commented on August 20, 2024

spring xml 改造

原来配置方法

		<!-- MonitorInterceptor 主要在log里面输出耗时时间 -->
		<mvc:interceptor>
			<!-- 默认所有 -->
			<!-- json请求不排除 -->
			<mvc:mapping path="/**" />

			<bean class="com.feilong.spring.web.servlet.interceptor.monitor.MonitorInterceptor">
				<!-- 性能阀值,单位毫秒 -->
				<property name="performanceThreshold" value="2000" />

				<property name="requestLogSwitch">
					<util:constant static-field="com.feilong.servlet.http.entity.RequestLogSwitch.NORMAL_WITH_IDENTITY_INCLUDE_FORWARD" />
				</property>

				<!-- 允许被json log输出的 request&&model 对象类型, 默认只有基本类型以及数组才会被输出. -->
				<property name="allowFormatClassTypes">
					<array>
						<value>com.feilong.web.command.ViewCommand</value>
					</array>
				</property>
			</bean>
		</mvc:interceptor>


改成

		<!-- MonitorInterceptor 主要在log里面输出耗时时间 -->
		<mvc:interceptor>
			<!-- 默认所有 -->
			<!-- json请求不排除 -->
			<mvc:mapping path="/**" />

			<bean class="com.feilong.spring.web.servlet.interceptor.monitor.MonitorInterceptor">
				<property name="monitorMessageEntity">
					<bean class="com.feilong.spring.web.servlet.interceptor.monitor.MonitorMessageEntity"><!-- 性能阀值,单位毫秒 -->
						<property name="performanceThreshold" value="2000" />

						<property name="requestLogSwitch">
							<util:constant static-field="com.feilong.servlet.http.entity.RequestLogSwitch.NORMAL" />
						</property>

						<!-- 允许被json log输出的 request&&model 对象类型, 默认只有基本类型以及数组才会被输出. -->
						<property name="allowFormatClassTypes">
							<array>
								<value>com.feilong.web.command.ViewCommand</value>
							</array>
						</property>
					</bean>
				</property>
			</bean>
		</mvc:interceptor>


并且加上 <property name="isShowRequestAttribute" value="false" />

<bean class="com.feilong.spring.web.servlet.interceptor.monitor.MonitorMessageEntity"><!-- 性能阀值,单位毫秒 -->
                        <property name="performanceThreshold" value="2000" />
                        
                        <property name="isShowRequestAttribute" value="false" />

                        <property name="requestLogSwitch">
                            <util:constant static-field="com.feilong.servlet.http.entity.RequestLogSwitch.NORMAL" />
                        </property>

                        <!-- 允许被json log输出的 request&&model 对象类型, 默认只有基本类型以及数组才会被输出. -->
                        <property name="allowFormatClassTypes">
                            <array>
                                <!-- <value>com.feilong.web.command.ViewCommand</value> -->
                            </array>
                        </property>
                    </bean>

from feilong-spring.

venusdrogon avatar venusdrogon commented on August 20, 2024
                        <property name="isShowRequestAttribute" value="false" />
                        <property name="isShowPostHandleLog" value="false" />
                        <property name="isShowAfterCompletionLog" value="false" />
                        <property name="isShowAfterConcurrentHandlingStartedLog" value="false" />

加上了4个属性

16:00:26 DEBUG (MonitorInterceptor.java:87) doPreHandle() - [Request] base info:    {
        "requestFullURL": "http://127.0.0.1:8092/pay/notifyError.htm?type=1",
        "requestMethod": "GET",
        "parameters": {"type": ["1"]}
    } ,start StopWatch
16:00:26 DEBUG (MemberDetailsInterceptor.java:91) preHandle() - Request don't need Login: /pay/notifyError.htm
16:00:26 DEBUG (LoginSessionBindInterceptor.java:87) preHandle() -     {
        "requestFullURL": "http://127.0.0.1:8092/pay/notifyError.htm?type=1",
        "requestMethod": "GET",
        "parameters": {"type": ["1"]}
    }
16:00:26 DEBUG (LoginSessionBindInterceptor.java:94) preHandle() - session is null,return true
16:00:26 INFO  (ResultNotifyErrorController.java:66) doNotifyError() -     {
        "requestFullURL": "http://127.0.0.1:8092/pay/notifyError.htm?type=1",
        "requestMethod": "GET",
        "parameters": {"type": ["1"]}
    }
16:00:26 DEBUG (ClientCacheInterceptor.java:184) setNoCacheAndLog() - [ResultNotifyErrorController.doNotifyError()],setNoCacheHeader,cause by: [isDefaultNoCache:[true]]
16:00:26 WARN  (DispatcherServlet.java:1116) noHandlerFound() - No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'springmvc'
16:00:26 WARN  (DispatcherServlet.java:1116) noHandlerFound() - No mapping found for HTTP request with URI [/errors/404400] in DispatcherServlet with name 'springmvc'

from feilong-spring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.