NutzCN Logo
问答 启动日志中有些跟数据相关的都重复打印了
发布于 1400天前 作者 ericleung 941 次浏览 复制 上一个帖子 下一个帖子
标签:

是不是有某些东西初始化两次了?

[DEBUG][2017-07-07 08:27:39,906][NutFilePool.java:37]:file-pool.home: 'C:\Users\180025.nutz\tmp\dao'
[INFO][2017-07-07 08:27:39,907][NutFilePool.java:66]:file-pool.cursor: 0
[DEBUG][2017-07-07 08:27:39,912][Jdbcs.java:90]:Jdbcs init complete
[DEBUG][2017-07-07 08:27:39,912][Jdbcs.java:90]:Jdbcs init complete
[INFO][2017-07-07 08:27:39,912][Jdbcs.java:103]:Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
[INFO][2017-07-07 08:27:39,912][Jdbcs.java:103]:Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
[INFO][2017-07-07 08:27:40,162][DruidDataSource.java:669]:{dataSource-1} inited
[DEBUG][2017-07-07 08:27:40,165][DaoSupport.java:188]:select expert : org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert
[DEBUG][2017-07-07 08:27:40,165][DaoSupport.java:188]:select expert : org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert
[DEBUG][2017-07-07 08:27:40,170][DaoSupport.java:199]:JDBC Driver --> mysql-connector-java-5.1.26 ( Revision: ${bzr.revision-id} )
[DEBUG][2017-07-07 08:27:40,170][DaoSupport.java:199]:JDBC Driver --> mysql-connector-java-5.1.26 ( Revision: ${bzr.revision-id} )
[DEBUG][2017-07-07 08:27:40,170][DaoSupport.java:200]:JDBC Name --> MySQL Connector Java
[DEBUG][2017-07-07 08:27:40,170][DaoSupport.java:200]:JDBC Name --> MySQL Connector Java
[DEBUG][2017-07-07 08:27:40,170][DaoSupport.java:202]:JDBC URL --> jdbc:mysql://localhost:3306/oms?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
[DEBUG][2017-07-07 08:27:40,170][DaoSupport.java:202]:JDBC URL --> jdbc:mysql://localhost:3306/oms?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
[DEBUG][2017-07-07 08:27:40,175][MysqlJdbcExpert.java:212]:Mysql : character_set_client=utf8
[DEBUG][2017-07-07 08:27:40,175][MysqlJdbcExpert.java:212]:Mysql : character_set_client=utf8
[DEBUG][2017-07-07 08:27:40,175][MysqlJdbcExpert.java:212]:Mysql : character_set_connection=utf8
[DEBUG][2017-07-07 08:27:40,175][MysqlJdbcExpert.java:212]:Mysql : character_set_connection=utf8
[DEBUG][2017-07-07 08:27:40,175][MysqlJdbcExpert.java:212]:Mysql : character_set_database=utf8
[DEBUG][2017-07-07 08:27:40,175][MysqlJdbcExpert.java:212]:Mysql : character_set_database=utf8
[DEBUG][2017-07-07 08:27:40,175][MysqlJdbcExpert.java:212]:Mysql : character_set_filesystem=binary
[DEBUG][2017-07-07 08:27:40,175][MysqlJdbcExpert.java:212]:Mysql : character_set_filesystem=binary
[DEBUG][2017-07-07 08:27:40,176][MysqlJdbcExpert.java:212]:Mysql : character_set_results=
[DEBUG][2017-07-07 08:27:40,176][MysqlJdbcExpert.java:212]:Mysql : character_set_results=
[DEBUG][2017-07-07 08:27:40,176][MysqlJdbcExpert.java:212]:Mysql : character_set_server=latin1
[DEBUG][2017-07-07 08:27:40,176][MysqlJdbcExpert.java:212]:Mysql : character_set_server=latin1
[DEBUG][2017-07-07 08:27:40,176][MysqlJdbcExpert.java:212]:Mysql : character_set_system=utf8
[DEBUG][2017-07-07 08:27:40,176][MysqlJdbcExpert.java:212]:Mysql : character_set_system=utf8
[DEBUG][2017-07-07 08:27:40,176][MysqlJdbcExpert.java:212]:Mysql : character_sets_dir=D:\xampp\mysql\share\charsets\
[DEBUG][2017-07-07 08:27:40,176][MysqlJdbcExpert.java:212]:Mysql : character_sets_dir=D:\xampp\mysql\share\charsets\
[DEBUG][2017-07-07 08:27:40,177][MysqlJdbcExpert.java:219]:Mysql : binlog_format=STATEMENT
[DEBUG][2017-07-07 08:27:40,177][MysqlJdbcExpert.java:219]:Mysql : binlog_format=STATEMENT
[DEBUG][2017-07-07 08:27:40,178][MysqlJdbcExpert.java:226]:Mysql : database=oms
[DEBUG][2017-07-07 08:27:40,178][MysqlJdbcExpert.java:226]:Mysql : database=oms
[DEBUG][2017-07-07 08:27:40,179][MysqlJdbcExpert.java:232]:Mysql : user=root@localhost
[DEBUG][2017-07-07 08:27:40,179][MysqlJdbcExpert.java:232]:Mysql : user=root@localhost
[DEBUG][2017-07-07 08:27:40,192][PreparedStatementPool.java:123]:stmt enter cache
[DEBUG][2017-07-07 08:27:40,193][DaoSupport.java:221]:Database info --> MYSQL:[MySQL - 5.5.5-10.1.13-MariaDB] [DEBUG][2017-07-07 08:27:40,193][DaoSupport.java:221]:Database info --> MYSQL:[MySQL - 5.5.5-10.1.13-MariaDB] [DEBUG][2017-07-07 08:27:40,196][DaoSupport.java:121]:SqlManager Sql count=0
[DEBUG][2017-07-07 08:27:40,196][DaoSupport.java:121]:SqlManager Sql count=0

MainModule
```@IocBy(type = ComboIocProvider.class,
args = {"*org.nutz.ioc.loader.json.JsonLoader",
"ioc/",
"*org.nutz.ioc.loader.annotation.AnnotationIocLoader",
"me.ericdev.oms.modules",
"me.ericdev.oms.services",
"me.ericdev.oms.updates",
"me.ericdev.oms.websocket",

    })

@Modules(scanPackage = true)
@SetupBy(AppSetup.class)
//@ChainBy(args={"chain/mychain.json"})
public class MainModule {
}

**数据库的json**

{
"ds": {
"type": "com.alibaba.druid.pool.DruidDataSource",
"events": {
"depose": "close"
},
"fields": {
"url": {"java": "me.ericdev.oms.C.URL"},
"username": {"java": "me.ericdev.oms.C.USERNAME"},
"password": {"java": "me.ericdev.oms.C.PASSWORD"},
"maxActive": 100,
"initialSize": 5,
"maxWait": 6000,
"minIdle": 1,
"timeBetweenEvictionRunsMillis": 60000,
"minEvictableIdleTimeMillis": 300000,
"validationQuery": "select 1 ",
"testWhileIdle": true,
"testOnBorrow": false,
"testOnReturn": false,
"poolPreparedStatements": false,
"maxPoolPreparedStatementPerConnectionSize": 20
}
},
"dao": {
"type": "org.nutz.dao.impl.NutDao",
"args": [{"refer": "ds"}, {"refer": "fileSqlManager"}]
},
"fileSqlManager":{
"type": "org.nutz.dao.impl.FileSqlManager",
"args": ["sqls"]
}
}

```

4 回复

那是log4j.properties有错误

这样子,我只想有需要才打印sql...

Global logging configuration

log4j.rootLogger=DEBUG, console

log4j.category.org.nutz.dao = DEBUG, console

别用category了,用logger

使用 additivity 解决了~
结了

添加回复
请先登陆
回到顶部