FS1360472174 / nosql-mongo

mongo knowledge
4 stars 4 forks source link

mongo log #45

Open FS1360472174 opened 6 years ago

FS1360472174 commented 6 years ago
  1. log4j.property 就是配置级别 jetty环境也没其他的配置了

DEBUG [org.springframework.data.mongodb.core.MongoTemplate] - find using query: { "expireDate" : { "$lt" : { "$date" : "2017-12-29T07:46:08.707Z"}} , "valid" : 0} fields: null for class: class com.xxx in collection: brandgood_coupon

FS1360472174 commented 6 years ago

log4j.logger.com.xxx.mapper=TRACE

FS1360472174 commented 6 years ago

log4j 除了log4j.properties文件,还需要进行注册。 PropertyConfigurator.configure(props); 同时要配合slf4j,l4j, common log的使用

FS1360472174 commented 6 years ago
  1. maven 项目配置log4j, 除了添加log4j.properties 文件,还需要配置监听器

    3 log4jConfigLocation 4 classpath:logback.properties 5

    6
    7
    8
    9 org.springframework.web.util.Log4jConfigListener
    10

    11

http://www.cnblogs.com/hnarea/p/7346374.html

对于spring-boot项目 http://blog.csdn.net/loongshawn/article/details/50951329

FS1360472174 commented 6 years ago

日志级别是INFO,为什么会有debug日志DEBUG [org.mongodb.driver.cluster] - Updating cluster description to {type=REPLICA_SET, servers=[ type=REPLICA_SET_SECONDARY, roundTripTime=4.6 ms, state=CONNECTED}type=REPLICA_SET_PRIMARY, roundTripTime=2.1 ms, state=CONNECTED}]