eclipse搭建springboot2.0.2、mybatis、springmvc、log4j、devtools热部署基本搭建
结合上一篇所述,我们先搭建一个基本开发的框架示例
和之前一样创建一个springboot的项目
选中web、MyBatis、JDBC、MySQL选项Finish完成
在resources下创建generator文件夹和application.yml文件并删除原有的application.properties文件(这里我比较习惯用yml)
mybatis自动生成的xml的配置
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE generatorConfiguration
- PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
- "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
- <generatorConfiguration>
- <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->
- <classPathEntry location="D:\cc_work\.m2\repository\mysql\mysql-connector-java\5.1.21\mysql-connector-java-5.1.21.jar"/>
- <context id="DB2Tables" targetRuntime="MyBatis3">
- <commentGenerator>
- <property name="suppressDate" value="true"/>
- <!-- 是否去除自动生成的注释 true:是 : false:否 -->
- <property name="suppressAllComments" value="true"/>
- </commentGenerator>
- <!--数据库链接URL,用户名、密码 -->
- <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1/springboot" userId="root" password="">
- </jdbcConnection>
- <javaTypeResolver>
- <property name="forceBigDecimals" value="false"/>
- </javaTypeResolver>
- <!-- 生成模型的包名和位置-->
- <javaModelGenerator targetPackage="com.springboot.domain.model" targetProject="springboot-test/src/main/java">
- <property name="enableSubPackages" value="true"/>
- <property name="trimStrings" value="true"/>
- </javaModelGenerator>
- <!-- 生成映射文件的包名和位置-->
- <sqlMapGenerator targetPackage="mapping" targetProject="springboot-test/src/main/resources">
- <property name="enableSubPackages" value="true"/>
- </sqlMapGenerator>
- <!-- 生成DAO的包名和位置-->
- <javaClientGenerator type="XMLMAPPER" targetPackage="com.springboot.domain.mapper" targetProject="springboot-test/src/main/java">
- <property name="enableSubPackages" value="true"/>
- </javaClientGenerator>
- <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
- <table tableName="wx_user" domainObjectName="WxUser" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">
- <property name="useActualColumnNames" value="true" />
- </table>
- </context>
- </generatorConfiguration>
- server:
- port: 80
- spring:
- mvc:
- view:
- prefix: /WEB-INF/jsp/
- suffix: .jsp
- datasource:
- url: jdbc:mysql://localhost:3306/springboot?useUnicode=true&characterEncoding=utf-8&useSSL=false
- username: root
- password:
- driver-class-name: com.mysql.jdbc.Driver
- mybatis:
- mapper-locations: classpath:mapping/*.xml
- type-aliases-package: com.springboot.domain.model
执行完生成后我们接下来吧service和controller也写完。我们先看一下结构
在src/main/下面创建一个webapp WEB-INF jsp文件夹 和index.jsp文件
接下来我贴一下代码
controller
- package com.springboot.controller;
- import java.util.List;
- import javax.annotation.Resource;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
- import com.springboot.domain.model.WxUser;
- import com.springboot.service.WxUserService;
- @Controller
- @RequestMapping("wxuser")
- public class TestController {
- @Resource
- private WxUserService wxUserService;
- @RequestMapping("index")
- public String index(){
- return "index";
- }
- @RequestMapping("getData")
- @ResponseBody
- public List<WxUser> getData(){
- return wxUserService.selectWxUserList();
- }
- }
service接口就不贴了,直接实现
- package com.springboot.service.impl;
- import java.util.List;
- import javax.annotation.Resource;
- import org.springframework.stereotype.Service;
- import com.springboot.domain.mapper.WxUserMapper;
- import com.springboot.domain.model.WxUser;
- import com.springboot.service.WxUserService;
- @Service
- public class WxUserServiceImpl implements WxUserService{
- @Resource
- private WxUserMapper wxUserMapper;
- @Override
- public List<WxUser> selectWxUserList() {
- return wxUserMapper.selectWxUserList();
- }
- }
dao接口
- package com.springboot.domain.mapper;
- import java.util.List;
- import com.springboot.domain.model.WxUser;
- public interface WxUserMapper {
- int deleteByPrimaryKey(Integer id);
- int insert(WxUser record);
- int insertSelective(WxUser record);
- WxUser selectByPrimaryKey(Integer id);
- int updateByPrimaryKeySelective(WxUser record);
- int updateByPrimaryKey(WxUser record);
- List<WxUser> selectWxUserList();
- }
mapping映射文件
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.springboot.domain.mapper.WxUserMapper" >
- <resultMap id="BaseResultMap" type="com.springboot.domain.model.WxUser" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="nickname" property="nickname" jdbcType="VARCHAR" />
- <result column="openid" property="openid" jdbcType="VARCHAR" />
- <result column="subscribe" property="subscribe" jdbcType="VARCHAR" />
- <result column="sex" property="sex" jdbcType="VARCHAR" />
- <result column="city" property="city" jdbcType="VARCHAR" />
- <result column="country" property="country" jdbcType="VARCHAR" />
- <result column="province" property="province" jdbcType="VARCHAR" />
- <result column="language" property="language" jdbcType="VARCHAR" />
- <result column="headimgurl" property="headimgurl" jdbcType="VARCHAR" />
- <result column="subscribe_time" property="subscribe_time" jdbcType="INTEGER" />
- <result column="unionid" property="unionid" jdbcType="VARCHAR" />
- <result column="remark" property="remark" jdbcType="VARCHAR" />
- <result column="groupid" property="groupid" jdbcType="VARCHAR" />
- <result column="subscribe_scene" property="subscribe_scene" jdbcType="VARCHAR" />
- <result column="qr_scene" property="qr_scene" jdbcType="VARCHAR" />
- <result column="qr_scene_str" property="qr_scene_str" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, nickname, openid, subscribe, sex, city, country, province, language, headimgurl,
- subscribe_time, unionid, remark, groupid, subscribe_scene, qr_scene, qr_scene_str
- </sql>
- <!-- 这里是自己写的 -->
- <select id="selectWxUserList" resultMap="BaseResultMap" >
- select
- <include refid="Base_Column_List" />
- from wx_user
- </select>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from wx_user
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from wx_user
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.springboot.domain.model.WxUser" >
- insert into wx_user (id, nickname, openid,
- subscribe, sex, city,
- country, province, language,
- headimgurl, subscribe_time, unionid,
- remark, groupid, subscribe_scene,
- qr_scene, qr_scene_str)
- values (#{id,jdbcType=INTEGER}, #{nickname,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR},
- #{subscribe,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},
- #{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR},
- #{headimgurl,jdbcType=VARCHAR}, #{subscribe_time,jdbcType=INTEGER}, #{unionid,jdbcType=VARCHAR},
- #{remark,jdbcType=VARCHAR}, #{groupid,jdbcType=VARCHAR}, #{subscribe_scene,jdbcType=VARCHAR},
- #{qr_scene,jdbcType=VARCHAR}, #{qr_scene_str,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.springboot.domain.model.WxUser" >
- insert into wx_user
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="nickname != null" >
- nickname,
- </if>
- <if test="openid != null" >
- openid,
- </if>
- <if test="subscribe != null" >
- subscribe,
- </if>
- <if test="sex != null" >
- sex,
- </if>
- <if test="city != null" >
- city,
- </if>
- <if test="country != null" >
- country,
- </if>
- <if test="province != null" >
- province,
- </if>
- <if test="language != null" >
- language,
- </if>
- <if test="headimgurl != null" >
- headimgurl,
- </if>
- <if test="subscribe_time != null" >
- subscribe_time,
- </if>
- <if test="unionid != null" >
- unionid,
- </if>
- <if test="remark != null" >
- remark,
- </if>
- <if test="groupid != null" >
- groupid,
- </if>
- <if test="subscribe_scene != null" >
- subscribe_scene,
- </if>
- <if test="qr_scene != null" >
- qr_scene,
- </if>
- <if test="qr_scene_str != null" >
- qr_scene_str,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=INTEGER},
- </if>
- <if test="nickname != null" >
- #{nickname,jdbcType=VARCHAR},
- </if>
- <if test="openid != null" >
- #{openid,jdbcType=VARCHAR},
- </if>
- <if test="subscribe != null" >
- #{subscribe,jdbcType=VARCHAR},
- </if>
- <if test="sex != null" >
- #{sex,jdbcType=VARCHAR},
- </if>
- <if test="city != null" >
- #{city,jdbcType=VARCHAR},
- </if>
- <if test="country != null" >
- #{country,jdbcType=VARCHAR},
- </if>
- <if test="province != null" >
- #{province,jdbcType=VARCHAR},
- </if>
- <if test="language != null" >
- #{language,jdbcType=VARCHAR},
- </if>
- <if test="headimgurl != null" >
- #{headimgurl,jdbcType=VARCHAR},
- </if>
- <if test="subscribe_time != null" >
- #{subscribe_time,jdbcType=INTEGER},
- </if>
- <if test="unionid != null" >
- #{unionid,jdbcType=VARCHAR},
- </if>
- <if test="remark != null" >
- #{remark,jdbcType=VARCHAR},
- </if>
- <if test="groupid != null" >
- #{groupid,jdbcType=VARCHAR},
- </if>
- <if test="subscribe_scene != null" >
- #{subscribe_scene,jdbcType=VARCHAR},
- </if>
- <if test="qr_scene != null" >
- #{qr_scene,jdbcType=VARCHAR},
- </if>
- <if test="qr_scene_str != null" >
- #{qr_scene_str,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.springboot.domain.model.WxUser" >
- update wx_user
- <set >
- <if test="nickname != null" >
- nickname = #{nickname,jdbcType=VARCHAR},
- </if>
- <if test="openid != null" >
- openid = #{openid,jdbcType=VARCHAR},
- </if>
- <if test="subscribe != null" >
- subscribe = #{subscribe,jdbcType=VARCHAR},
- </if>
- <if test="sex != null" >
- sex = #{sex,jdbcType=VARCHAR},
- </if>
- <if test="city != null" >
- city = #{city,jdbcType=VARCHAR},
- </if>
- <if test="country != null" >
- country = #{country,jdbcType=VARCHAR},
- </if>
- <if test="province != null" >
- province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="language != null" >
- language = #{language,jdbcType=VARCHAR},
- </if>
- <if test="headimgurl != null" >
- headimgurl = #{headimgurl,jdbcType=VARCHAR},
- </if>
- <if test="subscribe_time != null" >
- subscribe_time = #{subscribe_time,jdbcType=INTEGER},
- </if>
- <if test="unionid != null" >
- unionid = #{unionid,jdbcType=VARCHAR},
- </if>
- <if test="remark != null" >
- remark = #{remark,jdbcType=VARCHAR},
- </if>
- <if test="groupid != null" >
- groupid = #{groupid,jdbcType=VARCHAR},
- </if>
- <if test="subscribe_scene != null" >
- subscribe_scene = #{subscribe_scene,jdbcType=VARCHAR},
- </if>
- <if test="qr_scene != null" >
- qr_scene = #{qr_scene,jdbcType=VARCHAR},
- </if>
- <if test="qr_scene_str != null" >
- qr_scene_str = #{qr_scene_str,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.springboot.domain.model.WxUser" >
- update wx_user
- set nickname = #{nickname,jdbcType=VARCHAR},
- openid = #{openid,jdbcType=VARCHAR},
- subscribe = #{subscribe,jdbcType=VARCHAR},
- sex = #{sex,jdbcType=VARCHAR},
- city = #{city,jdbcType=VARCHAR},
- country = #{country,jdbcType=VARCHAR},
- province = #{province,jdbcType=VARCHAR},
- language = #{language,jdbcType=VARCHAR},
- headimgurl = #{headimgurl,jdbcType=VARCHAR},
- subscribe_time = #{subscribe_time,jdbcType=INTEGER},
- unionid = #{unionid,jdbcType=VARCHAR},
- remark = #{remark,jdbcType=VARCHAR},
- groupid = #{groupid,jdbcType=VARCHAR},
- subscribe_scene = #{subscribe_scene,jdbcType=VARCHAR},
- qr_scene = #{qr_scene,jdbcType=VARCHAR},
- qr_scene_str = #{qr_scene_str,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
然后我们在pom中需要加入jsp的依赖
在启动类上加入@MapperScan("com.springboot.domain.mapper")扫描
这里尤其要注意,SpringbootTestApplication这个类一定要在所有子包之上
接下来启动一下我们查看一下运行结果
我们访问一下网页
至此框架大体出现,接下来我们配置log4j,在pom文件中加入
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- log4j2 日志记录-->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-log4j2</artifactId>
- </dependency>
- <!-- 加上这个才能辨认到log4j2.yml文件 -->
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-yaml</artifactId>
- </dependency>
在resources中加入log4j2.yml
- Configuration:
- status: DEBUG
- Properties: # 定义全局变量
- Property: # 缺省配置(用于开发环境)。其他环境需要在VM参数中指定,如下:
- #测试:-Dlog.level.console=warn -Dlog.level.xjj=trace
- #生产:-Dlog.level.console=warn -Dlog.level.xjj=info
- - name: log.level.console
- value: trace
- - name: log.level.lee
- value: debug
- - name: log.path
- value: D://spring-boot//logs #log输出文件地址
- - name: project.name
- value: springboot-test #log文件名字
- Appenders:
- Console: #输出到控制台
- name: CONSOLE
- target: SYSTEM_OUT
- ThresholdFilter:
- level: ${sys:log.level.console} # “sys:”表示:如果VM参数中没指定这个变量值,则使用本文件中定义的缺省全局变量值
- onMatch: ACCEPT
- onMismatch: DENY
- PatternLayout:
- #pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n"
- pattern: "%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}"
- RollingFile:
- - name: ROLLING_FILE
- ignoreExceptions: false
- fileName: ${log.path}/${project.name}.log
- filePattern: "${log.path}/$${date:yyyy-MM}/${project.name}-%d{yyyy-MM-dd}-%i.log.gz"
- PatternLayout:
- pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n"
- Policies:
- SizeBasedTriggeringPolicy:
- size: "128 MB"
- DefaultRolloverStrategy:
- max: 1000
- Loggers:
- Root:
- level: info
- AppenderRef:
- - ref: CONSOLE
- - ref: ROLLING_FILE
- Logger: # 为com.lee包配置特殊的Log级别,方便调试
- - name: com.springboot
- additivity: false
- level: ${sys:log.level.lee}
- AppenderRef:
- - ref: CONSOLE
- - ref: ROLLING_FILE
启动输出:
- 2018-05-29 15:42:57,712 main DEBUG Initializing configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml]
- 2018-05-29 15:42:57,719 main DEBUG Installed 1 script engine
- 2018-05-29 15:42:58,046 main DEBUG Oracle Nashorn version: 1.8.0_152, language: ECMAScript, threading: Not Thread Safe, compile: true, names: [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], factory class: jdk.nashorn.api.scripting.NashornScriptEngineFactory
- 2018-05-29 15:42:58,047 main DEBUG PluginManager 'Core' found 116 plugins
- 2018-05-29 15:42:58,047 main DEBUG PluginManager 'Level' found 0 plugins
- 2018-05-29 15:42:58,047 main DEBUG Processing node for object Properties
- 2018-05-29 15:42:58,047 main DEBUG Processing node for array Property
- 2018-05-29 15:42:58,047 main DEBUG Processing Property[0]
- 2018-05-29 15:42:58,048 main DEBUG Processing Property[1]
- 2018-05-29 15:42:58,048 main DEBUG Processing Property[2]
- 2018-05-29 15:42:58,048 main DEBUG Processing Property[3]
- 2018-05-29 15:42:58,048 main DEBUG Returning Properties with parent root of type properties:class org.apache.logging.log4j.core.config.PropertiesPlugin
- 2018-05-29 15:42:58,048 main DEBUG Processing node for object Appenders
- 2018-05-29 15:42:58,049 main DEBUG Processing node for object Console
- 2018-05-29 15:42:58,049 main DEBUG Node name is of type STRING
- 2018-05-29 15:42:58,049 main DEBUG Node target is of type STRING
- 2018-05-29 15:42:58,049 main DEBUG Processing node for object ThresholdFilter
- 2018-05-29 15:42:58,051 main DEBUG Node level is of type STRING
- 2018-05-29 15:42:58,051 main DEBUG Node onMatch is of type STRING
- 2018-05-29 15:42:58,051 main DEBUG Node onMismatch is of type STRING
- 2018-05-29 15:42:58,052 main DEBUG Returning ThresholdFilter with parent Console of type filter:class org.apache.logging.log4j.core.filter.ThresholdFilter
- 2018-05-29 15:42:58,052 main DEBUG Processing node for object PatternLayout
- 2018-05-29 15:42:58,052 main DEBUG Node pattern is of type STRING
- 2018-05-29 15:42:58,052 main DEBUG Returning PatternLayout with parent Console of type layout:class org.apache.logging.log4j.core.layout.PatternLayout
- 2018-05-29 15:42:58,053 main DEBUG Returning Console with parent Appenders of type appender:class org.apache.logging.log4j.core.appender.ConsoleAppender
- 2018-05-29 15:42:58,053 main DEBUG Processing node for array RollingFile
- 2018-05-29 15:42:58,053 main DEBUG Processing RollingFile[0]
- 2018-05-29 15:42:58,053 main DEBUG Processing node for object PatternLayout
- 2018-05-29 15:42:58,053 main DEBUG Node pattern is of type STRING
- 2018-05-29 15:42:58,054 main DEBUG Returning PatternLayout with parent RollingFile of type layout:class org.apache.logging.log4j.core.layout.PatternLayout
- 2018-05-29 15:42:58,054 main DEBUG Processing node for object Policies
- 2018-05-29 15:42:58,054 main DEBUG Processing node for object SizeBasedTriggeringPolicy
- 2018-05-29 15:42:58,054 main DEBUG Node size is of type STRING
- 2018-05-29 15:42:58,055 main DEBUG Returning SizeBasedTriggeringPolicy with parent Policies of type SizeBasedTriggeringPolicy:class org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy
- 2018-05-29 15:42:58,055 main DEBUG Returning Policies with parent RollingFile of type Policies:class org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy
- 2018-05-29 15:42:58,056 main DEBUG Processing node for object DefaultRolloverStrategy
- 2018-05-29 15:42:58,060 main DEBUG Node max is of type NUMBER
- 2018-05-29 15:42:58,060 main DEBUG Returning DefaultRolloverStrategy with parent RollingFile of type DefaultRolloverStrategy:class org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy
- 2018-05-29 15:42:58,061 main DEBUG Returning Appenders with parent root of type appenders:class org.apache.logging.log4j.core.config.AppendersPlugin
- 2018-05-29 15:42:58,061 main DEBUG Processing node for object Loggers
- 2018-05-29 15:42:58,061 main DEBUG Processing node for object Root
- 2018-05-29 15:42:58,061 main DEBUG Node level is of type STRING
- 2018-05-29 15:42:58,062 main DEBUG Processing node for array AppenderRef
- 2018-05-29 15:42:58,062 main DEBUG Processing AppenderRef[0]
- 2018-05-29 15:42:58,062 main DEBUG Processing AppenderRef[1]
- 2018-05-29 15:42:58,062 main DEBUG Processing node for array Logger
- 2018-05-29 15:42:58,062 main DEBUG Processing Logger[0]
- 2018-05-29 15:42:58,063 main DEBUG Processing array for object AppenderRef
- 2018-05-29 15:42:58,063 main DEBUG Node ref is of type STRING
- 2018-05-29 15:42:58,063 main DEBUG Returning AppenderRef with parent Logger of type AppenderRef:class org.apache.logging.log4j.core.config.AppenderRef
- 2018-05-29 15:42:58,064 main DEBUG Node ref is of type STRING
- 2018-05-29 15:42:58,064 main DEBUG Returning AppenderRef with parent Logger of type AppenderRef:class org.apache.logging.log4j.core.config.AppenderRef
- 2018-05-29 15:42:58,064 main DEBUG Returning Root with parent Loggers of type root:class org.apache.logging.log4j.core.config.LoggerConfig$RootLogger
- 2018-05-29 15:42:58,064 main DEBUG Returning Loggers with parent root of type loggers:class org.apache.logging.log4j.core.config.LoggersPlugin
- 2018-05-29 15:42:58,065 main DEBUG Completed parsing configuration
- 2018-05-29 15:42:58,070 main DEBUG Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property].
- 2018-05-29 15:42:58,087 main DEBUG PluginManager 'TypeConverter' found 26 plugins
- 2018-05-29 15:42:58,097 main DEBUG createProperty(name="log.level.console", value="trace")
- 2018-05-29 15:42:58,097 main DEBUG Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property].
- 2018-05-29 15:42:58,098 main DEBUG createProperty(name="log.level.lee", value="debug")
- 2018-05-29 15:42:58,099 main DEBUG Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property].
- 2018-05-29 15:42:58,099 main DEBUG createProperty(name="log.path", value="D://spring-boot//logs")
- 2018-05-29 15:42:58,099 main DEBUG Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property].
- 2018-05-29 15:42:58,100 main DEBUG createProperty(name="project.name", value="springboot-test")
- 2018-05-29 15:42:58,100 main DEBUG Building Plugin[name=properties, class=org.apache.logging.log4j.core.config.PropertiesPlugin].
- 2018-05-29 15:42:58,115 main DEBUG configureSubstitutor(={log.level.console=trace, log.level.lee=debug, log.path=D://spring-boot//logs, project.name=springboot-test}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml))
- 2018-05-29 15:42:58,116 main DEBUG PluginManager 'Lookup' found 13 plugins
- 2018-05-29 15:42:58,117 main DEBUG Building Plugin[name=filter, class=org.apache.logging.log4j.core.filter.ThresholdFilter].
- 2018-05-29 15:42:58,122 main DEBUG createFilter(level="TRACE", onMatch="ACCEPT", onMismatch="DENY")
- 2018-05-29 15:42:58,123 main DEBUG Building Plugin[name=layout, class=org.apache.logging.log4j.core.layout.PatternLayout].
- 2018-05-29 15:42:58,129 main DEBUG PatternLayout$Builder(pattern="%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}", PatternSelector=null, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Replace=null, charset="null", alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", header="null", footer="null")
- 2018-05-29 15:42:58,130 main DEBUG PluginManager 'Converter' found 45 plugins
- 2018-05-29 15:42:58,158 main DEBUG Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.ConsoleAppender].
- 2018-05-29 15:42:58,165 main DEBUG ConsoleAppender$Builder(target="SYSTEM_OUT", follow="null", direct="null", bufferedIo="null", bufferSize="null", immediateFlush="null", ignoreExceptions="null", PatternLayout(%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}), name="CONSOLE", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), ThresholdFilter(TRACE))
- 2018-05-29 15:42:58,167 main DEBUG Starting OutputStreamManager SYSTEM_OUT.false.false
- 2018-05-29 15:42:58,167 main DEBUG Building Plugin[name=layout, class=org.apache.logging.log4j.core.layout.PatternLayout].
- 2018-05-29 15:42:58,168 main DEBUG PatternLayout$Builder(pattern="%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n", PatternSelector=null, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Replace=null, charset="null", alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", header="null", footer="null")
- 2018-05-29 15:42:58,169 main DEBUG Building Plugin[name=SizeBasedTriggeringPolicy, class=org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy].
- 2018-05-29 15:42:58,171 main DEBUG createPolicy(size="128 MB")
- 2018-05-29 15:42:58,172 main DEBUG Building Plugin[name=Policies, class=org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy].
- 2018-05-29 15:42:58,174 main DEBUG createPolicy(={SizeBasedTriggeringPolicy(size=134217728)})
- 2018-05-29 15:42:58,175 main DEBUG Building Plugin[name=DefaultRolloverStrategy, class=org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy].
- 2018-05-29 15:42:58,178 main DEBUG DefaultRolloverStrategy$Builder(max="1000", min="null", fileIndex="null", compressionLevel="null", ={}, stopCustomActionsOnError="null", tempCompressedFilePattern="null", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml))
- 2018-05-29 15:42:58,179 main DEBUG Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.RollingFileAppender].
- 2018-05-29 15:42:58,181 main DEBUG RollingFileAppender$Builder(fileName="D://spring-boot//logs/springboot-test.log", filePattern="D://spring-boot//logs/${date:yyyy-MM}/springboot-test-%d{yyyy-MM-dd}-%i.log.gz", append="null", locking="null", Policies(CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=134217728)])), DefaultRolloverStrategy(DefaultRolloverStrategy(min=1, max=1000, useMax=true)), advertise="null", advertiseUri="null", createOnDemand="null", filePermissions="null", fileOwner="null", fileGroup="null", bufferedIo="null", bufferSize="null", immediateFlush="null", ignoreExceptions="false", PatternLayout(%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n), name="ROLLING_FILE", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)
- 2018-05-29 15:42:58,186 main DEBUG Starting RollingFileManager D://spring-boot//logs/springboot-test.log
- 2018-05-29 15:42:58,188 main DEBUG PluginManager 'FileConverter' found 2 plugins
- 2018-05-29 15:42:58,189 main DEBUG Setting prev file time to 2018-05-29T15:42:58.186+0800
- 2018-05-29 15:42:58,191 main DEBUG Initializing triggering policy CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=134217728)])
- 2018-05-29 15:42:58,191 main DEBUG Building Plugin[name=appenders, class=org.apache.logging.log4j.core.config.AppendersPlugin].
- 2018-05-29 15:42:58,192 main DEBUG createAppenders(={CONSOLE, ROLLING_FILE})
- 2018-05-29 15:42:58,192 main DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
- 2018-05-29 15:42:58,193 main DEBUG createAppenderRef(ref="CONSOLE", level="null", Filter=null)
- 2018-05-29 15:42:58,193 main DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
- 2018-05-29 15:42:58,194 main DEBUG createAppenderRef(ref="ROLLING_FILE", level="null", Filter=null)
- 2018-05-29 15:42:58,194 main DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
- 2018-05-29 15:42:58,194 main DEBUG createAppenderRef(ref="CONSOLE", level="null", Filter=null)
- 2018-05-29 15:42:58,195 main DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
- 2018-05-29 15:42:58,196 main DEBUG createAppenderRef(ref="ROLLING_FILE", level="null", Filter=null)
- 2018-05-29 15:42:58,196 main DEBUG Building Plugin[name=logger, class=org.apache.logging.log4j.core.config.LoggerConfig].
- 2018-05-29 15:42:58,207 main DEBUG createLogger(additivity="false", level="DEBUG", name="com.springboot", includeLocation="null", ={CONSOLE, ROLLING_FILE}, ={}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)
- 2018-05-29 15:42:58,209 main DEBUG Building Plugin[name=root, class=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger].
- 2018-05-29 15:42:58,210 main ERROR root Root has no parameter that matches element Logger
- 2018-05-29 15:42:58,210 main DEBUG createLogger(additivity="null", level="INFO", includeLocation="null", ={CONSOLE, ROLLING_FILE}, ={}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)
- 2018-05-29 15:42:58,211 main DEBUG Building Plugin[name=loggers, class=org.apache.logging.log4j.core.config.LoggersPlugin].
- 2018-05-29 15:42:58,211 main DEBUG createLoggers(={root})
- 2018-05-29 15:42:58,212 main DEBUG Configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] initialized
- 2018-05-29 15:42:58,212 main DEBUG Starting configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml]
- 2018-05-29 15:42:58,212 main DEBUG Started configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] OK.
- 2018-05-29 15:42:58,213 main DEBUG Shutting down OutputStreamManager SYSTEM_OUT.false.false-1
- 2018-05-29 15:42:58,213 main DEBUG Shut down OutputStreamManager SYSTEM_OUT.false.false-1, all resources released: true
- 2018-05-29 15:42:58,214 main DEBUG Appender DefaultConsole-1 stopped with status true
- 2018-05-29 15:42:58,214 main DEBUG Stopped [email protected]57 OK
- 2018-05-29 15:42:58,219 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6
- 2018-05-29 15:42:58,221 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=StatusLogger
- 2018-05-29 15:42:58,223 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=ContextSelector
- 2018-05-29 15:42:58,225 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Loggers,name=
- 2018-05-29 15:42:58,227 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Appenders,name=CONSOLE
- 2018-05-29 15:42:58,228 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Appenders,name=ROLLING_FILE
- 2018-05-29 15:42:58,231 main DEBUG Reconfiguration complete for context[name=764c12b6] at URI D:\cc_work\demo\springboot-test\target\classes\log4j2.yml ([email protected]) with optional ClassLoader: null
- 2018-05-29 15:42:58,231 main DEBUG Shutdown hook enabled. Registering a new one.
- 2018-05-29 15:42:58,233 main DEBUG LoggerContext[name=764c12b6, [email protected]] started OK.
- 2018-05-29 15:42:58,540 main DEBUG Reconfiguration started for context[name=764c12b6] at URI null ([email protected]) with optional ClassLoader: null
- 2018-05-29 15:42:58,541 main DEBUG Using configurationFactory or[email protected]7803bfd
- 2018-05-29 15:42:58,546 main INFO Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory.
- 2018-05-29 15:42:58,552 main DEBUG Initializing configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml]
- 2018-05-29 15:42:58,553 main DEBUG Installed 1 script engine
- 2018-05-29 15:42:58,565 main DEBUG Oracle Nashorn version: 1.8.0_152, language: ECMAScript, threading: Not Thread Safe, compile: true, names: [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], factory class: jdk.nashorn.api.scripting.NashornScriptEngineFactory
- 2018-05-29 15:42:58,566 main DEBUG PluginManager 'Core' found 116 plugins
- 2018-05-29 15:42:58,566 main DEBUG PluginManager 'Level' found 0 plugins
- 2018-05-29 15:42:58,566 main DEBUG Processing node for object Properties
- 2018-05-29 15:42:58,566 main DEBUG Processing node for array Property
- 2018-05-29 15:42:58,567 main DEBUG Processing Property[0]
- 2018-05-29 15:42:58,567 main DEBUG Processing Property[1]
- 2018-05-29 15:42:58,567 main DEBUG Processing Property[2]
- 2018-05-29 15:42:58,567 main DEBUG Processing Property[3]
- 2018-05-29 15:42:58,567 main DEBUG Returning Properties with parent root of type properties:class org.apache.logging.log4j.core.config.PropertiesPlugin
- 2018-05-29 15:42:58,568 main DEBUG Processing node for object Appenders
- 2018-05-29 15:42:58,568 main DEBUG Processing node for object Console
- 2018-05-29 15:42:58,568 main DEBUG Node name is of type STRING
- 2018-05-29 15:42:58,568 main DEBUG Node target is of type STRING
- 2018-05-29 15:42:58,569 main DEBUG Processing node for object ThresholdFilter
- 2018-05-29 15:42:58,569 main DEBUG Node level is of type STRING
- 2018-05-29 15:42:58,569 main DEBUG Node onMatch is of type STRING
- 2018-05-29 15:42:58,569 main DEBUG Node onMismatch is of type STRING
- 2018-05-29 15:42:58,569 main DEBUG Returning ThresholdFilter with parent Console of type filter:class org.apache.logging.log4j.core.filter.ThresholdFilter
- 2018-05-29 15:42:58,570 main DEBUG Processing node for object PatternLayout
- 2018-05-29 15:42:58,570 main DEBUG Node pattern is of type STRING
- 2018-05-29 15:42:58,570 main DEBUG Returning PatternLayout with parent Console of type layout:class org.apache.logging.log4j.core.layout.PatternLayout
- 2018-05-29 15:42:58,570 main DEBUG Returning Console with parent Appenders of type appender:class org.apache.logging.log4j.core.appender.ConsoleAppender
- 2018-05-29 15:42:58,570 main DEBUG Processing node for array RollingFile
- 2018-05-29 15:42:58,571 main DEBUG Processing RollingFile[0]
- 2018-05-29 15:42:58,571 main DEBUG Processing node for object PatternLayout
- 2018-05-29 15:42:58,571 main DEBUG Node pattern is of type STRING
- 2018-05-29 15:42:58,571 main DEBUG Returning PatternLayout with parent RollingFile of type layout:class org.apache.logging.log4j.core.layout.PatternLayout
- 2018-05-29 15:42:58,571 main DEBUG Processing node for object Policies
- 2018-05-29 15:42:58,572 main DEBUG Processing node for object SizeBasedTriggeringPolicy
- 2018-05-29 15:42:58,572 main DEBUG Node size is of type STRING
- 2018-05-29 15:42:58,572 main DEBUG Returning SizeBasedTriggeringPolicy with parent Policies of type SizeBasedTriggeringPolicy:class org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy
- 2018-05-29 15:42:58,572 main DEBUG Returning Policies with parent RollingFile of type Policies:class org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy
- 2018-05-29 15:42:58,572 main DEBUG Processing node for object DefaultRolloverStrategy
- 2018-05-29 15:42:58,573 main DEBUG Node max is of type NUMBER
- 2018-05-29 15:42:58,573 main DEBUG Returning DefaultRolloverStrategy with parent RollingFile of type DefaultRolloverStrategy:class org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy
- 2018-05-29 15:42:58,573 main DEBUG Returning Appenders with parent root of type appenders:class org.apache.logging.log4j.core.config.AppendersPlugin
- 2018-05-29 15:42:58,573 main DEBUG Processing node for object Loggers
- 2018-05-29 15:42:58,574 main DEBUG Processing node for object Root
- 2018-05-29 15:42:58,574 main DEBUG Node level is of type STRING
- 2018-05-29 15:42:58,574 main DEBUG Processing node for array AppenderRef
- 2018-05-29 15:42:58,574 main DEBUG Processing AppenderRef[0]
- 2018-05-29 15:42:58,574 main DEBUG Processing AppenderRef[1]
- 2018-05-29 15:42:58,575 main DEBUG Processing node for array Logger
- 2018-05-29 15:42:58,575 main DEBUG Processing Logger[0]
- 2018-05-29 15:42:58,575 main DEBUG Processing array for object AppenderRef
- 2018-05-29 15:42:58,575 main DEBUG Node ref is of type STRING
- 2018-05-29 15:42:58,576 main DEBUG Returning AppenderRef with parent Logger of type AppenderRef:class org.apache.logging.log4j.core.config.AppenderRef
- 2018-05-29 15:42:58,599 main DEBUG Node ref is of type STRING
- 2018-05-29 15:42:58,599 main DEBUG Returning AppenderRef with parent Logger of type AppenderRef:class org.apache.logging.log4j.core.config.AppenderRef
- 2018-05-29 15:42:58,599 main DEBUG Returning Root with parent Loggers of type root:class org.apache.logging.log4j.core.config.LoggerConfig$RootLogger
- 2018-05-29 15:42:58,600 main DEBUG Returning Loggers with parent root of type loggers:class org.apache.logging.log4j.core.config.LoggersPlugin
- 2018-05-29 15:42:58,600 main DEBUG Completed parsing configuration
- 2018-05-29 15:42:58,600 main DEBUG Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property].
- 2018-05-29 15:42:58,601 main DEBUG createProperty(name="log.level.console", value="trace")
- 2018-05-29 15:42:58,601 main DEBUG Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property].
- 2018-05-29 15:42:58,601 main DEBUG createProperty(name="log.level.lee", value="debug")
- 2018-05-29 15:42:58,601 main DEBUG Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property].
- 2018-05-29 15:42:58,602 main DEBUG createProperty(name="log.path", value="D://spring-boot//logs")
- 2018-05-29 15:42:58,602 main DEBUG Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property].
- 2018-05-29 15:42:58,602 main DEBUG createProperty(name="project.name", value="springboot-test")
- 2018-05-29 15:42:58,603 main DEBUG Building Plugin[name=properties, class=org.apache.logging.log4j.core.config.PropertiesPlugin].
- 2018-05-29 15:42:58,604 main DEBUG configureSubstitutor(={log.level.console=trace, log.level.lee=debug, log.path=D://spring-boot//logs, project.name=springboot-test}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml))
- 2018-05-29 15:42:58,605 main DEBUG PluginManager 'Lookup' found 13 plugins
- 2018-05-29 15:42:58,606 main DEBUG Building Plugin[name=filter, class=org.apache.logging.log4j.core.filter.ThresholdFilter].
- 2018-05-29 15:42:58,606 main DEBUG createFilter(level="TRACE", onMatch="ACCEPT", onMismatch="DENY")
- 2018-05-29 15:42:58,606 main DEBUG Building Plugin[name=layout, class=org.apache.logging.log4j.core.layout.PatternLayout].
- 2018-05-29 15:42:58,607 main DEBUG PatternLayout$Builder(pattern="%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}", PatternSelector=null, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Replace=null, charset="null", alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", header="null", footer="null")
- 2018-05-29 15:42:58,607 main DEBUG PluginManager 'Converter' found 45 plugins
- 2018-05-29 15:42:58,610 main DEBUG Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.ConsoleAppender].
- 2018-05-29 15:42:58,611 main DEBUG ConsoleAppender$Builder(target="SYSTEM_OUT", follow="null", direct="null", bufferedIo="null", bufferSize="null", immediateFlush="null", ignoreExceptions="null", PatternLayout(%highlight{%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n}{STYLE=Logback}), name="CONSOLE", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), ThresholdFilter(TRACE))
- 2018-05-29 15:42:58,613 main DEBUG Building Plugin[name=layout, class=org.apache.logging.log4j.core.layout.PatternLayout].
- 2018-05-29 15:42:58,613 main DEBUG PatternLayout$Builder(pattern="%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n", PatternSelector=null, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Replace=null, charset="null", alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", header="null", footer="null")
- 2018-05-29 15:42:58,614 main DEBUG Building Plugin[name=SizeBasedTriggeringPolicy, class=org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy].
- 2018-05-29 15:42:58,614 main DEBUG createPolicy(size="128 MB")
- 2018-05-29 15:42:58,615 main DEBUG Building Plugin[name=Policies, class=org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy].
- 2018-05-29 15:42:58,615 main DEBUG createPolicy(={SizeBasedTriggeringPolicy(size=134217728)})
- 2018-05-29 15:42:58,615 main DEBUG Building Plugin[name=DefaultRolloverStrategy, class=org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy].
- 2018-05-29 15:42:58,616 main DEBUG DefaultRolloverStrategy$Builder(max="1000", min="null", fileIndex="null", compressionLevel="null", ={}, stopCustomActionsOnError="null", tempCompressedFilePattern="null", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml))
- 2018-05-29 15:42:58,616 main DEBUG Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.RollingFileAppender].
- 2018-05-29 15:42:58,616 main DEBUG RollingFileAppender$Builder(fileName="D://spring-boot//logs/springboot-test.log", filePattern="D://spring-boot//logs/${date:yyyy-MM}/springboot-test-%d{yyyy-MM-dd}-%i.log.gz", append="null", locking="null", Policies(CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=134217728)])), DefaultRolloverStrategy(DefaultRolloverStrategy(min=1, max=1000, useMax=true)), advertise="null", advertiseUri="null", createOnDemand="null", filePermissions="null", fileOwner="null", fileGroup="null", bufferedIo="null", bufferSize="null", immediateFlush="null", ignoreExceptions="false", PatternLayout(%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n), name="ROLLING_FILE", Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)
- 2018-05-29 15:42:58,617 main DEBUG PluginManager 'FileConverter' found 2 plugins
- 2018-05-29 15:42:58,617 main DEBUG Building Plugin[name=appenders, class=org.apache.logging.log4j.core.config.AppendersPlugin].
- 2018-05-29 15:42:58,617 main DEBUG createAppenders(={CONSOLE, ROLLING_FILE})
- 2018-05-29 15:42:58,618 main DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
- 2018-05-29 15:42:58,631 main DEBUG createAppenderRef(ref="CONSOLE", level="null", Filter=null)
- 2018-05-29 15:42:58,632 main DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
- 2018-05-29 15:42:58,632 main DEBUG createAppenderRef(ref="ROLLING_FILE", level="null", Filter=null)
- 2018-05-29 15:42:58,632 main DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
- 2018-05-29 15:42:58,633 main DEBUG createAppenderRef(ref="CONSOLE", level="null", Filter=null)
- 2018-05-29 15:42:58,633 main DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
- 2018-05-29 15:42:58,633 main DEBUG createAppenderRef(ref="ROLLING_FILE", level="null", Filter=null)
- 2018-05-29 15:42:58,633 main DEBUG Building Plugin[name=logger, class=org.apache.logging.log4j.core.config.LoggerConfig].
- 2018-05-29 15:42:58,634 main DEBUG createLogger(additivity="false", level="DEBUG", name="com.springboot", includeLocation="null", ={CONSOLE, ROLLING_FILE}, ={}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)
- 2018-05-29 15:42:58,634 main DEBUG Building Plugin[name=root, class=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger].
- 2018-05-29 15:42:58,636 main ERROR root Root has no parameter that matches element Logger
- 2018-05-29 15:42:58,636 main DEBUG createLogger(additivity="null", level="INFO", includeLocation="null", ={CONSOLE, ROLLING_FILE}, ={}, Configuration(D:\cc_work\demo\springboot-test\target\classes\log4j2.yml), Filter=null)
- 2018-05-29 15:42:58,637 main DEBUG Building Plugin[name=loggers, class=org.apache.logging.log4j.core.config.LoggersPlugin].
- 2018-05-29 15:42:58,637 main DEBUG createLoggers(={root})
- 2018-05-29 15:42:58,637 main DEBUG Configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] initialized
- 2018-05-29 15:42:58,637 main DEBUG Starting configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml]
- 2018-05-29 15:42:58,638 main DEBUG Started configuration YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] OK.
- 2018-05-29 15:42:58,639 main DEBUG Appender ROLLING_FILE stopped with status true
- 2018-05-29 15:42:58,639 main DEBUG Appender CONSOLE stopped with status true
- 2018-05-29 15:42:58,640 main DEBUG Stopped YamlConfiguration[location=D:\cc_work\demo\springboot-test\target\classes\log4j2.yml] OK
- 2018-05-29 15:42:58,641 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6
- 2018-05-29 15:42:58,642 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=StatusLogger
- 2018-05-29 15:42:58,642 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=ContextSelector
- 2018-05-29 15:42:58,642 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Loggers,name=
- 2018-05-29 15:42:58,643 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Appenders,name=CONSOLE
- 2018-05-29 15:42:58,643 main DEBUG Registering MBean org.apache.logging.log4j2:type=764c12b6,component=Appenders,name=ROLLING_FILE
- 2018-05-29 15:42:58,643 main DEBUG Reconfiguration complete for context[name=764c12b6] at URI D:\cc_work\demo\springboot-test\target\classes\log4j2.yml ([email protected]) with optional ClassLoader: null
- . ____ _ __ _ _
- /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
- ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
- \\/ ___)| |_)| | | | | || (_| | ) ) ) )
- ' |____| .__|_| |_|_| |_\__, | / / / /
- =========|_|==============|___/=/_/_/_/
- :: Spring Boot :: (v2.0.2.RELEASE)
- 2018-05-29 15:42:58,787:INFO main (StartupInfoLogger.java:50) - Starting SpringbootTestApplication on CC-PC with PID 22252 (D:\cc_work\demo\springboot-test\target\classes started by xiamonian in D:\cc_work\demo\springboot-test)
- 2018-05-29 15:42:58,790 main DEBUG AsyncLogger.ThreadNameStrategy=UNCACHED (user specified null, default is UNCACHED)
- 2018-05-29 15:42:58,792:INFO main (SpringApplication.java:659) - No active profile set, falling back to default profiles: default
- 2018-05-29 15:42:58,886:INFO main (AbstractApplicationContext.java:590) - Refreshing org.springframework.boot.web.ser[email protected]63798ca7: startup date [Tue May 29 15:42:58 CST 2018]; root of context hierarchy
- 2018-05-29 15:43:00,743:INFO main (TomcatWebServer.java:91) - Tomcat initialized with port(s): 80 (http)
- 2018-05-29 15:43:00,763:INFO main (DirectJDKLog.java:180) - Initializing ProtocolHandler ["http-nio-80"]
- 2018-05-29 15:43:00,779:INFO main (DirectJDKLog.java:180) - Starting service [Tomcat]
- 2018-05-29 15:43:00,780:INFO main (DirectJDKLog.java:180) - Starting Servlet Engine: Apache Tomcat/8.5.31
- 2018-05-29 15:43:00,793:INFO localhost-startStop-1 (DirectJDKLog.java:180) - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_152\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_152/bin/server;C:/Program Files/Java/jre1.8.0_152/bin;C:/Program Files/Java/jre1.8.0_152/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files\Java\jdk1.8.0_152\jre\bin;D:\cc_work\apache-maven-3.1.1\bin\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;%MYSQL_HOME%\bin;C:\Users\xiamonian\AppData\Local\Microsoft\WindowsApps;C:\Users\xiamonian\AppData\Roaming\npm;;D:\cc_work\eclipse;;.]
- 2018-05-29 15:43:01,008:INFO localhost-startStop-1 (DirectJDKLog.java:180) - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
- 2018-05-29 15:43:01,020:INFO localhost-startStop-1 (DirectJDKLog.java:180) - Initializing Spring embedded WebApplicationContext
- 2018-05-29 15:43:01,021:INFO localhost-startStop-1 (ServletWebServerApplicationContext.java:285) - Root WebApplicationContext: initialization completed in 2138 ms
- 2018-05-29 15:43:01,288:INFO localhost-startStop-1 (ServletRegistrationBean.java:185) - Servlet dispatcherServlet mapped to [/]
- 2018-05-29 15:43:01,295:INFO localhost-startStop-1 (AbstractFilterRegistrationBean.java:244) - Mapping filter: 'characterEncodingFilter' to: [/*]
- 2018-05-29 15:43:01,297:INFO localhost-startStop-1 (AbstractFilterRegistrationBean.java:244) - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
- 2018-05-29 15:43:01,297:INFO localhost-startStop-1 (AbstractFilterRegistrationBean.java:244) - Mapping filter: 'httpPutFormContentFilter' to: [/*]
- 2018-05-29 15:43:01,297:INFO localhost-startStop-1 (AbstractFilterRegistrationBean.java:244) - Mapping filter: 'requestContextFilter' to: [/*]
- 2018-05-29 15:43:01,889:INFO main (AbstractUrlHandlerMapping.java:373) - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
- 2018-05-29 15:43:02,147:INFO main (RequestMappingHandlerAdapter.java:574) - Looking for @ControllerAdvice: org.springframework.boot.web.ser[email protected]63798ca7: startup date [Tue May 29 15:42:58 CST 2018]; root of context hierarchy
- 2018-05-29 15:43:02,253:INFO main (AbstractHandlerMethodMapping.java:547) - Mapped "{[/wxuser/index]}" onto public java.lang.String com.springboot.controller.TestController.index()
- 2018-05-29 15:43:02,254:INFO main (AbstractHandlerMethodMapping.java:547) - Mapped "{[/wxuser/getData]}" onto public java.util.List<com.springboot.domain.model.WxUser> com.springboot.controller.TestController.getData()
- 2018-05-29 15:43:02,257:INFO main (AbstractHandlerMethodMapping.java:547) - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
- 2018-05-29 15:43:02,258:INFO main (AbstractHandlerMethodMapping.java:547) - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
- 2018-05-29 15:43:02,308:INFO main (AbstractUrlHandlerMapping.java:373) - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
- 2018-05-29 15:43:02,308:INFO main (AbstractUrlHandlerMapping.java:373) - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
- 2018-05-29 15:43:02,385:INFO main (WelcomePageHandlerMapping.java:61) - Adding welcome page template: index
- 2018-05-29 15:43:02,711:INFO main (MBeanExporter.java:433) - Registering beans for JMX exposure on startup
- 2018-05-29 15:43:02,713:INFO main (MBeanExporter.java:895) - Bean with name 'dataSource' has been autodetected for JMX exposure
- 2018-05-29 15:43:02,720:INFO main (MBeanExporter.java:668) - Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
- 2018-05-29 15:43:02,729:INFO main (DirectJDKLog.java:180) - Starting ProtocolHandler ["http-nio-80"]
- 2018-05-29 15:43:02,744:INFO main (DirectJDKLog.java:180) - Using a shared selector for servlet write/read
- 2018-05-29 15:43:02,782:INFO main (TomcatWebServer.java:206) - Tomcat started on port(s): 80 (http) with context path ''
- 2018-05-29 15:43:02,787:INFO main (StartupInfoLogger.java:59) - Started SpringbootTestApplication in 4.5 seconds (JVM running for 6.28)
我们发现相较于之前多出了很多日志出现
接下来是devtools热部署,对于开发来说爽多了,比关闭再启动都要快很多很多~~~~看一下pom的配置
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-devtools</artifactId>
- <optional>true</optional> <!-- 表示依赖不会传递 -->
- </dependency>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <configuration>
- <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
- </configuration>
- </plugin>
- </plugins>
- </build>