本机已经成功搭建NutzWk项目,可正常运行查看示例。
每次启动控制台会有以下日志输出:
[INFO] web.xml file = file:///F:/WEB_PROJECT/MAVEN/NutzWk/wk-app/wk-web/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = F:\WEB_PROJECT\MAVEN\NutzWk\wk-app\wk-web\src\main\webapp
2017-08-21 14:48:44.816:INFO:oejs.Server:main: jetty-9.4.2.v20170220
2017-08-21 14:48:58.531:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=13435ms
2017-08-21 14:48:58.834:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2017-08-21 14:48:58.834:INFO:oejs.session:main: No SessionScavenger set, using defaults
2017-08-21 14:48:58.836:INFO:oejs.session:main: Scavenging every 600000ms
2017-08-21 14:48:58.882:INFO:oejC.118102ee:main: Initializing Shiro environment
2017-08-21 14:48:58,883 [main] INFO org.apache.shiro.web.env.EnvironmentLoader - Starting Shiro environmen t initialization.
2017-08-21 14:48:59,075 [main] INFO org.apache.shiro.config.ReflectionBuilder - An instance with name 'aut hc' already exists. Redefining this object as a new instance of type cn.wizzer.app.web.commons.shiro.filte r.PlatformAuthenticationFilter
2017-08-21 14:48:59,282 [main] WARN net.sf.ehcache.config.CacheConfiguration - Statistics can no longer be enabled via configuration.
2017-08-21 14:48:59,566 [main] INFO org.apache.shiro.cache.ehcache.EhCacheManager - Cache with name 'shiro DbRealm.authorizationCache' does not yet exist. Creating now.
2017-08-21 14:48:59,594 [main] INFO org.apache.shiro.cache.ehcache.EhCacheManager - Added EhCache named [s hiroDbRealm.authorizationCache]
2017-08-21 14:48:59,625 [main] INFO org.apache.shiro.config.IniSecurityManagerFactory - Realms have been e xplicitly set on the SecurityManager instance - auto-setting of realms will not occur.
2017-08-21 14:48:59,635 [main] INFO org.apache.shiro.web.env.EnvironmentLoader - Shiro environment initial ized in 752 ms.
2017-08-21 14:48:59,828 [main] INFO org.nutz.mvc.NutFilter - NutFilter[nutz] starting ...
2017-08-21 14:48:59,972 [main] INFO org.nutz.mvc.impl.NutLoading - Nutz Version : 1.r.63-SNAPSHOT
2017-08-21 14:48:59,972 [main] INFO org.nutz.mvc.impl.NutLoading - Nutz.Mvc[nutz] is initializing ...
2017-08-21 14:49:00,328 [main] INFO org.nutz.ioc.loader.annotation.AnnotationIocLoader - Found 90 classes in 1 base-packages!
beans = ["wxTplListController", "uploadController", "wxReplyTxtServiceImpl", "sysDictController", "wxMassSe ndServiceImpl", "rSAUtil", "wxReplyNewsServiceImpl", "sysLoginController", "wxTplLogServiceImpl", "dateUtil ", "sysUserServiceImpl", "wxConfigController", "stringUtil", "sysRoleServiceImpl", "qrcodeService", "sysRou teController", "idcardUtil", "wxTplListServiceImpl", "tplService", "sysPluginServiceImpl", "wxUserServiceIm pl", "cmsController", "cmsChannelServiceImpl", "cmsArticleController", "wxMenuController", "nutShiroMethodI nterceptor", "dynamicInterceptor", "weixinController", "sysLogController", "wxMassController", "emailServic e", "code128Util", "wxMsgReplyServiceImpl", "wxMenuServiceImpl", "wxReplyNewsController", "cmsLinkClassServ iceImpl", "sysRouteServiceImpl", "sysHomeController", "cmsLinkClassController", "wxMassNewsServiceImpl", "w xMassServiceImpl", "cmsArticleServiceImpl", "sysMenuServiceImpl", "wxHandler", "cmsChannelController", "wxR eplyController", "wxController", "sysConfigServiceImpl", "rabbitProducer", "cookieUtil", "sysTaskServiceImp l", "wxMsgServiceImpl", "sysLogServiceImpl", "wxPayBackController", "wxReplyServiceImpl", "bdController", " redisIdGenerator", "wxTplIdServiceImpl", "sysTaskController", "shiroUtil", "cmsSiteController", "$aop_syslo g", "wxReplyTxtController", "sysDictServiceImpl", "sysPluginController", "wxConfigServiceImpl", "apiTestCon troller", "sysMenuController", "wxTplLogController", "cmsSiteServiceImpl", "sysApiServiceImpl", "wxUserCont roller", "wxPayTestController", "sLogService", "tokenController", "cmsLinkController", "sysApiController", "cmsLinkServiceImpl", "sysUnitServiceImpl", "wxTplIdController", "sysRoleController", "sysUserController", "platformAuthorizingRealm", "sysConfController", "pluginMaster", "testJob", "wechatController", "sysUnitCon troller", "wxMsgUserController", "$aop_1_plugin"]
2017-08-21 14:49:00,378 [main] INFO org.nutz.ioc.loader.annotation.AnnotationIocLoader - Found 4 classes i n 1 base-packages!
beans = ["wkcacheRemoveAllInterceptor", "wkcacheResultInterceptor", "$aop_wkcache", "wkcacheRemoveEntryInte rceptor"]
2017-08-21 14:49:00,383 [main] INFO org.nutz.ioc.impl.NutIoc - NutIoc init begin ...
2017-08-21 14:49:00,386 [main] INFO org.nutz.ioc.impl.NutIoc - ... NutIoc init complete
2017-08-21 14:49:00,389 [main] INFO org.nutz.mvc.impl.NutLoading - Build URL mapping by org.nutz.mvc.impl. UrlMappingImpl ...
2017-08-21 14:49:00,751 [main] INFO org.nutz.filepool.NutFilePool - Init file-pool by: ~/nutzwk/upload/tmp [1000]
2017-08-21 14:49:00,752 [main] INFO org.nutz.filepool.NutFilePool - file-pool.cursor: 0
2017-08-21 14:49:01,326 [main] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
2017-08-21 14:49:01,642 [main] INFO org.nutz.dao.jdbc.Jdbcs - Get Connection from DataSource for JdbcExper t, if you lock at here, check your database server and configure
2017-08-21 14:49:02,037 [main] INFO org.nutz.mvc.impl.NutLoading - Found 259 module methods
2017-08-21 14:49:02,043 [main] INFO org.nutz.mvc.impl.NutLoading - SessionBy --> cn.wizzer.framework.shiro .ShiroSessionProvider@2506b881
2017-08-21 14:49:02,043 [main] INFO org.nutz.mvc.impl.NutLoading - Setup application...
2017-08-21 14:49:02,044 [main] INFO cn.wizzer.app.web.commons.core.Setup - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1
2017-08-21 14:49:02,045 [main] WARN cn.wizzer.app.web.commons.core.Setup - This project must run in UTF-8, pls add -Dfile.encoding=UTF-8 to JAVA_OPTS
2017-08-21 14:49:02,630 [main] INFO org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor
2017-08-21 14:49:02,636 [main] INFO org.quartz.simpl.SimpleThreadPool - Job execution threads will use cla ss loader of thread: main
2017-08-21 14:49:02,657 [main] INFO org.quartz.core.SchedulerSignalerImpl - Initialized Scheduler Signalle r of type: class org.quartz.core.SchedulerSignalerImpl
2017-08-21 14:49:02,657 [main] INFO org.quartz.core.QuartzScheduler - Quartz Scheduler v.2.2.3 created.
2017-08-21 14:49:02,658 [main] INFO org.quartz.plugins.management.ShutdownHookPlugin - Registering Quartz shutdown hook.
2017-08-21 14:49:02,659 [main] INFO org.quartz.impl.jdbcjobstore.JobStoreTX - Using db table-based data ac cess locking (synchronization).
2017-08-21 14:49:02,663 [main] INFO org.quartz.impl.jdbcjobstore.JobStoreTX - JobStoreTX initialized.
2017-08-21 14:49:02,664 [main] INFO org.quartz.core.QuartzScheduler - Scheduler meta-data: Quartz Schedule r (v2.2.3) 'defaultScheduler' with instanceId 'QinYe-feiyue1503298142635'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 2 threads.
Using job-store 'org.quartz.impl.jdbcjobstore.JobStoreTX' - which supports persistence. and is clustered.
2017-08-21 14:49:02,664 [main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler 'defaultSchedul er' initialized from default resource file in Quartz package: 'quartz.properties'
2017-08-21 14:49:02,664 [main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 2.2.3
2017-08-21 14:49:02,703 [main] INFO org.quartz.core.QuartzScheduler - JobFactory set to: org.nutz.integrat ion.quartz.NutQuartzJobFactory@25699aa7
2017-08-21 14:49:02,755 [main] INFO org.quartz.impl.jdbcjobstore.JobStoreTX - ClusterManager: detected 1 f ailed or restarted instances.
2017-08-21 14:49:02,755 [main] INFO org.quartz.impl.jdbcjobstore.JobStoreTX - ClusterManager: Scanning for instance "QinYe-feiyue1503297687192"'s failed in-progress jobs.
2017-08-21 14:49:02,759 [main] INFO org.quartz.core.QuartzScheduler - Scheduler defaultScheduler_$_QinYe-f eiyue1503298142635 started.
2017-08-21 14:49:02,789 [main] INFO org.nutz.mvc.impl.NutLoading - Nutz.Mvc[nutz] is up in 2816ms
2017-08-21 14:49:02,789 [main] INFO org.nutz.mvc.NutFilter - exclusionsPrefix = ^(/assets/|/druid/|/uploa d/|/apidoc/)
2017-08-21 14:49:02.845:INFO:oejsh.ContextHandler:main: Started o.e.j.m.p.JettyWebAppContext@118102ee{/,fil e:///F:/WEB_PROJECT/MAVEN/NutzWk/wk-app/wk-web/src/main/webapp/,AVAILABLE}{file:///F:/WEB_PROJECT/MAVEN/Nut zWk/wk-app/wk-web/src/main/webapp/}
2017-08-21 14:49:02.872:INFO:oejs.AbstractNCSARequestLog:main: Opened F:\WEB_PROJECT\MAVEN\NutzWk\wk-app\wk -web\target\access-2017_08_21.log
2017-08-21 14:49:02.881:INFO:oejs.AbstractConnector:main: Started ServerConnector@38c460e8{HTTP/1.1,[http/1 .1]}{0.0.0.0:8080}
2017-08-21 14:49:02.883:INFO:oejs.Server:main: Started @54481ms
[INFO] Started Jetty Server
[INFO] org.eclipse.jetty.server.Server@5432c277 - STARTED
+= qtp1069531012{STARTED,8<=8<=200,i=3,q=0} - STARTED
| +- 13 qtp1069531012-13 TIMED_WAITING @ sun.misc.Unsafe.park(Native Method) IDLE
| +- 20 qtp1069531012-20 TIMED_WAITING @ sun.misc.Unsafe.park(Native Method) IDLE
| +- 14 qtp1069531012-14-lowPrioritySelector RUNNABLE @ org.eclipse.jetty.io.ManagedSelector$SelectorPro ducer.produce(ManagedSelector.java:244) prio=1
| +- 16 qtp1069531012-16 RUNNABLE @ sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
| +- 19 qtp1069531012-19 RUNNABLE @ sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
| +- 15 qtp1069531012-15-lowPrioritySelector BLOCKED @ org.eclipse.jetty.io.ManagedSelector$SelectorProd ucer.produce(ManagedSelector.java:244) prio=1
| +- 18 qtp1069531012-18 TIMED_WAITING @ sun.misc.Unsafe.park(Native Method) IDLE
| +- 17 qtp1069531012-17-acceptor-0@1d548f99-ServerConnector@38c460e8{HTTP/1.1,[http/1.1]}{0.0.0.0:8080} RUNNABLE @ sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) prio=3
| +- jobs
+= org.eclipse.jetty.maven.plugin.MavenServerConnector@25567581 - STARTED
+= org.eclipse.jetty.server.handler.HandlerCollection@179ee36b[org.eclipse.jetty.server.handler.ContextHan dlerCollection@67763ebe[o.e.j.m.p.JettyWebAppContext@118102ee{/,file:///F:/WEB_PROJECT/MAVEN/NutzWk/wk-app/ wk-web/src/main/webapp/,AVAILABLE}{file:///F:/WEB_PROJECT/MAVEN/NutzWk/wk-app/wk-web/src/main/webapp/}], or g.eclipse.jetty.server.handler.DefaultHandler@4b4a2fa8, org.eclipse.jetty.server.handler.RequestLogHandler@ 5da6b13d] - STARTED
| += org.eclipse.jetty.server.handler.ContextHandlerCollection@67763ebe[o.e.j.m.p.JettyWebAppContext@118 102ee{/,file:///F:/WEB_PROJECT/MAVEN/NutzWk/wk-app/wk-web/src/main/webapp/,AVAILABLE}{file:///F:/WEB_PROJEC T/MAVEN/NutzWk/wk-app/wk-web/src/main/webapp/}] - STARTED
| | += o.e.j.m.p.JettyWebAppContext@118102ee{/,file:///F:/WEB_PROJECT/MAVEN/NutzWk/wk-app/wk-web/src/m ain/webapp/,AVAILABLE}{file:///F:/WEB_PROJECT/MAVEN/NutzWk/wk-app/wk-web/src/main/webapp/} - STARTED
| | += org.eclipse.jetty.server.session.SessionHandler1036227673==dftMaxIdleSec=1800 - STARTED
此处摘要效果,没有全部拷贝
我查看项目配置【~/wk-app/wk-web//src/main/resources/log4j.properties】配置如下:
log4j.rootLogger=debug,Console,file
log4j.logger.org.apache.commons.beanutils=error
log4j.logger.org.quartz.core.QuartzSchedulerThread=info
log4j.logger.org.apache.shiro.web=error
log4j.logger.net.sf.ehcache.statistics=error
log4j.logger.net.sf.ehcache=error
log4j.logger.org.apache.shiro.session=error
log4j.logger.org.apache.shiro.mgt=error
log4j.logger.org.apache.shiro.cache.ehcache=error
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%-5p] %d %l - %m%n
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=./logs/nutzwk.log
log4j.appender.file.MaxFileSize=100MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=[%-5p] %d %l - %m%n
#log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.file.File=${catalina.base}/logs/nutzwk.log
#log4j.appender.file.DatePattern='.'yyyy-MM-dd'.log'
#log4j.appender.file.layout=org.apache.log4j.PatternLayout
#log4j.appender.file.layout.ConversionPattern=[%-5p] %d %l - %m%n
我将日志级别由【debug】改为【info / error】还是会输出很多,后来查到原Nutz框架有以下示例也试过(改为更高级别也不行),还是没有达到理想效果
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
备注:每次改完配置文件,重新回到【~/wk-app】目录下编译,再进入【~/wk-app/wk-web】运行,war包解压看过配置文件没问题