正在显示
6 个修改的文件
包含
584 行增加
和
0 行删除
.gitignore
0 → 100644
| 1 | +HELP.md | ||
| 2 | +target/ | ||
| 3 | +!.mvn/wrapper/maven-wrapper.jar | ||
| 4 | +!**/src/main/** | ||
| 5 | +!**/src/test/** | ||
| 6 | + | ||
| 7 | +### STS ### | ||
| 8 | +.apt_generated | ||
| 9 | +.classpath | ||
| 10 | +.factorypath | ||
| 11 | +.project | ||
| 12 | +.settings | ||
| 13 | +.springBeans | ||
| 14 | +.sts4-cache | ||
| 15 | + | ||
| 16 | +### IntelliJ IDEA ### | ||
| 17 | +.idea | ||
| 18 | +*.iws | ||
| 19 | +*.iml | ||
| 20 | +*.ipr | ||
| 21 | + | ||
| 22 | +### NetBeans ### | ||
| 23 | +/nbproject/private/ | ||
| 24 | +/nbbuild/ | ||
| 25 | +/dist/ | ||
| 26 | +/nbdist/ | ||
| 27 | +/.nb-gradle/ | ||
| 28 | +build/ | ||
| 29 | + | ||
| 30 | +### VS Code ### | ||
| 31 | +.vscode/ | 
config/application.yml
0 → 100644
| 1 | +server: | ||
| 2 | + port: 8888 | ||
| 3 | + | ||
| 4 | +# spring 配置 | ||
| 5 | +spring: | ||
| 6 | + application: | ||
| 7 | + name: cloud-config-server | ||
| 8 | + profiles: | ||
| 9 | + active: dev | ||
| 10 | + cloud: | ||
| 11 | + config: | ||
| 12 | + label: master | ||
| 13 | + server: | ||
| 14 | + git: | ||
| 15 | + uri: http://118.31.66.166:8099/cloud-config/cloud-config-center.git | ||
| 16 | + search-paths: respo | ||
| 17 | + username: 523186180@qq.com | ||
| 18 | + password: 523186180 | ||
| 19 | + | ||
| 20 | + # zipkin 配置 | ||
| 21 | + zipkin: | ||
| 22 | + base-url: http://192.168.1.63:9411 | ||
| 23 | + sleuth: | ||
| 24 | + sampler: | ||
| 25 | + probability: 1 | ||
| 26 | + | ||
| 27 | +# 日志配置 | ||
| 28 | +logback: | ||
| 29 | + appname: cloud-config-center | ||
| 30 | + logdir: ./log | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +#eureka client | ||
| 34 | +eureka: | ||
| 35 | + instance: | ||
| 36 | + status-page-url: http://${eureka.instance.hostname}:${server.port}/index | ||
| 37 | + prefer-ip-address: true | ||
| 38 | + instance-id: ${spring.cloud.client.ip-address}:${server.port} | ||
| 39 | + hostname: ${spring.cloud.client.ip-address} | ||
| 40 | + | ||
| 41 | + client: | ||
| 42 | + healthcheck: | ||
| 43 | + enabled: true | ||
| 44 | + service-url: | ||
| 45 | + defaultZone: http://192.168.1.53:12345/eureka/ | ||
| 46 | + | ||
| 47 | +# boot admin | ||
| 48 | +management: | ||
| 49 | + endpoints: | ||
| 50 | + enabled-by-default: true | ||
| 51 | + web: | ||
| 52 | + exposure: | ||
| 53 | + include: ["*"] | ||
| 54 | + endpoint: | ||
| 55 | + health: | ||
| 56 | + show-details: always | ||
| 57 | + shutdown: | ||
| 58 | + enabled: true | ||
| 59 | + | ||
| 60 | +info: | ||
| 61 | + version: 1.0 | ||
| 62 | + description: "cloud,配置中心" | 
config/logback-dev.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!--参考文档链接:https://blog.csdn.net/qq_34912478/article/details/80877132--> | ||
| 3 | +<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> | ||
| 4 | +<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true --> | ||
| 5 | +<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> | ||
| 6 | +<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> | ||
| 7 | +<configuration scan="true" scanPeriod="10 seconds"> | ||
| 8 | + | ||
| 9 | + <!--<include resource="org/springframework/boot/logging/logback/base.xml" />--> | ||
| 10 | + | ||
| 11 | + <contextName>logback</contextName> | ||
| 12 | + <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 --> | ||
| 13 | + <property name="log.path" value="./logs" /> | ||
| 14 | + | ||
| 15 | + <!-- 彩色日志 --> | ||
| 16 | + <!-- 彩色日志依赖的渲染类 --> | ||
| 17 | + <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> | ||
| 18 | + <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> | ||
| 19 | + <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> | ||
| 20 | + <!-- 彩色日志格式 --> | ||
| 21 | + <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + <!--输出到控制台--> | ||
| 25 | + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
| 26 | + <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> | ||
| 27 | + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
| 28 | + <level>debug</level> | ||
| 29 | + </filter> | ||
| 30 | + <encoder> | ||
| 31 | + <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> | ||
| 32 | + <!-- 设置字符集 windows系统这里设置成GBK--> | ||
| 33 | + <charset>UTF-8</charset> | ||
| 34 | + </encoder> | ||
| 35 | + </appender> | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + <!--输出到文件--> | ||
| 39 | + | ||
| 40 | + <!-- 时间滚动输出 level为 DEBUG 日志 --> | ||
| 41 | + <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 42 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
| 43 | + <file>${log.path}/log_debug.log</file> | ||
| 44 | + <!--日志文件输出格式--> | ||
| 45 | + <encoder> | ||
| 46 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
| 47 | + <charset>UTF-8</charset> <!-- 设置字符集 --> | ||
| 48 | + </encoder> | ||
| 49 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
| 50 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| 51 | + <!-- 日志归档 --> | ||
| 52 | + <fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
| 53 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
| 54 | + <maxFileSize>100MB</maxFileSize> | ||
| 55 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
| 56 | + <!--日志文件保留天数--> | ||
| 57 | + <maxHistory>15</maxHistory> | ||
| 58 | + </rollingPolicy> | ||
| 59 | + <!-- 此日志文件只记录debug级别的 --> | ||
| 60 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
| 61 | + <level>debug</level> | ||
| 62 | + <onMatch>ACCEPT</onMatch> | ||
| 63 | + <onMismatch>DENY</onMismatch> | ||
| 64 | + </filter> | ||
| 65 | + </appender> | ||
| 66 | + | ||
| 67 | + <!-- 时间滚动输出 level为 INFO 日志 --> | ||
| 68 | + <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 69 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
| 70 | + <file>${log.path}/log_info.log</file> | ||
| 71 | + <!--日志文件输出格式--> | ||
| 72 | + <encoder> | ||
| 73 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
| 74 | + <charset>UTF-8</charset> | ||
| 75 | + </encoder> | ||
| 76 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
| 77 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| 78 | + <!-- 每天日志归档路径以及格式 --> | ||
| 79 | + <fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
| 80 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
| 81 | + <maxFileSize>100MB</maxFileSize> | ||
| 82 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
| 83 | + <!--日志文件保留天数--> | ||
| 84 | + <maxHistory>15</maxHistory> | ||
| 85 | + </rollingPolicy> | ||
| 86 | + <!-- 此日志文件只记录info级别的 --> | ||
| 87 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
| 88 | + <level>info</level> | ||
| 89 | + <onMatch>ACCEPT</onMatch> | ||
| 90 | + <onMismatch>DENY</onMismatch> | ||
| 91 | + </filter> | ||
| 92 | + </appender> | ||
| 93 | + | ||
| 94 | + <!-- 时间滚动输出 level为 WARN 日志 --> | ||
| 95 | + <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 96 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
| 97 | + <file>${log.path}/log_warn.log</file> | ||
| 98 | + <!--日志文件输出格式--> | ||
| 99 | + <encoder> | ||
| 100 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
| 101 | + <charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
| 102 | + </encoder> | ||
| 103 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
| 104 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| 105 | + <fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
| 106 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
| 107 | + <maxFileSize>100MB</maxFileSize> | ||
| 108 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
| 109 | + <!--日志文件保留天数--> | ||
| 110 | + <maxHistory>15</maxHistory> | ||
| 111 | + </rollingPolicy> | ||
| 112 | + <!-- 此日志文件只记录warn级别的 --> | ||
| 113 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
| 114 | + <level>warn</level> | ||
| 115 | + <onMatch>ACCEPT</onMatch> | ||
| 116 | + <onMismatch>DENY</onMismatch> | ||
| 117 | + </filter> | ||
| 118 | + </appender> | ||
| 119 | + | ||
| 120 | + | ||
| 121 | + <!-- 时间滚动输出 level为 ERROR 日志 --> | ||
| 122 | + <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 123 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
| 124 | + <file>${log.path}/log_error.log</file> | ||
| 125 | + <!--日志文件输出格式--> | ||
| 126 | + <encoder> | ||
| 127 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
| 128 | + <charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
| 129 | + </encoder> | ||
| 130 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
| 131 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| 132 | + <fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
| 133 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
| 134 | + <maxFileSize>100MB</maxFileSize> | ||
| 135 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
| 136 | + <!--日志文件保留天数--> | ||
| 137 | + <maxHistory>15</maxHistory> | ||
| 138 | + </rollingPolicy> | ||
| 139 | + <!-- 此日志文件只记录ERROR级别的 --> | ||
| 140 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
| 141 | + <level>ERROR</level> | ||
| 142 | + <onMatch>ACCEPT</onMatch> | ||
| 143 | + <onMismatch>DENY</onMismatch> | ||
| 144 | + </filter> | ||
| 145 | + </appender> | ||
| 146 | + | ||
| 147 | + <!-- 时间滚动输出 level为 trace 日志 --> | ||
| 148 | + <appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 149 | + <!-- 正在记录的日志文件的路径及文件名 --> | ||
| 150 | + <file>${log.path}/log_trace.log</file> | ||
| 151 | + <!--日志文件输出格式--> | ||
| 152 | + <encoder> | ||
| 153 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> | ||
| 154 | + <charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
| 155 | + </encoder> | ||
| 156 | + <!-- 日志记录器的滚动策略,按日期,按大小记录 --> | ||
| 157 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| 158 | + <fileNamePattern>${log.path}/trace/log-trace-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
| 159 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
| 160 | + <maxFileSize>100MB</maxFileSize> | ||
| 161 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
| 162 | + <!--日志文件保留天数--> | ||
| 163 | + <maxHistory>15</maxHistory> | ||
| 164 | + </rollingPolicy> | ||
| 165 | + <!-- 此日志文件只记录trace级别的 --> | ||
| 166 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
| 167 | + <level>TRACE</level> | ||
| 168 | + <onMatch>ACCEPT</onMatch> | ||
| 169 | + <onMismatch>DENY</onMismatch> | ||
| 170 | + </filter> | ||
| 171 | + </appender> | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + <!-- | ||
| 175 | + <logger>用来设置某一个包或者具体的某一个类的日志打印级别、 | ||
| 176 | + 以及指定<appender>。<logger>仅有一个name属性, | ||
| 177 | + 一个可选的level和一个可选的addtivity属性。 | ||
| 178 | + name:用来指定受此logger约束的某一个包或者具体的某一个类。 | ||
| 179 | + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, | ||
| 180 | + 还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 | ||
| 181 | + 如果未设置此属性,那么当前logger将会继承上级的级别。 | ||
| 182 | + addtivity:是否向上级logger传递打印信息。默认是true。 | ||
| 183 | + --> | ||
| 184 | + <!--<logger name="org.springframework.web" level="info"/>--> | ||
| 185 | + <!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>--> | ||
| 186 | + <!-- | ||
| 187 | + 使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: | ||
| 188 | + 第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 | ||
| 189 | + 第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: | ||
| 190 | + --> | ||
| 191 | + | ||
| 192 | + | ||
| 193 | + <!-- | ||
| 194 | + root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 | ||
| 195 | + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, | ||
| 196 | + 不能设置为INHERITED或者同义词NULL。默认是DEBUG | ||
| 197 | + 可以包含零个或多个元素,标识这个appender将会添加到这个logger。 | ||
| 198 | + --> | ||
| 199 | + <!--<logger name="com.tianbo.analysis" level="trace">--> | ||
| 200 | + <!--<appender-ref ref="CONSOLE" />--> | ||
| 201 | + <!--<appender-ref ref="TRACE_FILE" />--> | ||
| 202 | + <!--<appender-ref ref="DEBUG_FILE" />--> | ||
| 203 | + <!--<appender-ref ref="INFO_FILE" />--> | ||
| 204 | + <!--<appender-ref ref="WARN_FILE" />--> | ||
| 205 | + <!--<appender-ref ref="ERROR_FILE" />--> | ||
| 206 | + <!--</logger>--> | ||
| 207 | + | ||
| 208 | + <!--开发环境:打印控制台--> | ||
| 209 | + <springProfile name="dev"> | ||
| 210 | + <logger name="org.springframework" level="info"/> | ||
| 211 | + <logger name="com.sunyo.wlpt.nmms.mapper" level="debug"> | ||
| 212 | + <appender-ref ref="CONSOLE" /> | ||
| 213 | + <appender-ref ref="DEBUG_FILE" /> | ||
| 214 | + </logger> | ||
| 215 | + <logger name="org.apache.tomcat" level="info" /> | ||
| 216 | + <root level="info"> | ||
| 217 | + <appender-ref ref="CONSOLE" /> | ||
| 218 | + <appender-ref ref="TRACE_FILE" /> | ||
| 219 | + <appender-ref ref="DEBUG_FILE" /> | ||
| 220 | + <appender-ref ref="INFO_FILE" /> | ||
| 221 | + <appender-ref ref="WARN_FILE" /> | ||
| 222 | + <appender-ref ref="ERROR_FILE" /> | ||
| 223 | + </root> | ||
| 224 | + </springProfile> | ||
| 225 | + | ||
| 226 | + <!--生产环境:输出到文件--> | ||
| 227 | + <springProfile name="pro"> | ||
| 228 | + <logger name="org.springframework" level="INFO"/> | ||
| 229 | + <root level="info"> | ||
| 230 | + <appender-ref ref="CONSOLE" /> | ||
| 231 | + <appender-ref ref="DEBUG_FILE" /> | ||
| 232 | + <appender-ref ref="INFO_FILE" /> | ||
| 233 | + <appender-ref ref="ERROR_FILE" /> | ||
| 234 | + <appender-ref ref="WARN_FILE" /> | ||
| 235 | + <appender-ref ref="TRACE_FILE" /> | ||
| 236 | + </root> | ||
| 237 | + </springProfile> | ||
| 238 | + | ||
| 239 | +</configuration> | 
config/logback-spring.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<configuration scan="ture" scanPeriod="60 seconds" debug="false"> | ||
| 3 | + | ||
| 4 | + <springProperty scope="context" name="appname" source="logback.appname"/> | ||
| 5 | + <springProperty scope="context" name="logdir" source="logback.logdir"/> | ||
| 6 | + <!--文件名--> | ||
| 7 | + <contextName>${appname}</contextName> | ||
| 8 | + | ||
| 9 | + <!--输出到控制面板--> | ||
| 10 | + <appender name="consoleLog1" class="ch.qos.logback.core.ConsoleAppender"> | ||
| 11 | + <!-- layout输出方式输出--> | ||
| 12 | + <layout class="ch.qos.logback.classic.PatternLayout"> | ||
| 13 | + <pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
| 14 | + </layout> | ||
| 15 | + </appender> | ||
| 16 | + <!--输出到控制面板--> | ||
| 17 | + <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender"> | ||
| 18 | + <encoder> | ||
| 19 | + <pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
| 20 | + </encoder> | ||
| 21 | + </appender> | ||
| 22 | + <!--输出info级别日志--> | ||
| 23 | + <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 24 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
| 25 | + <!--过滤 Error--> | ||
| 26 | + <level>ERROR</level> | ||
| 27 | + <!--匹配到就禁止--> | ||
| 28 | + <onMatch>DENY</onMatch> | ||
| 29 | + <!--没有匹配到就允许--> | ||
| 30 | + <onMismatch>ACCEPT</onMismatch> | ||
| 31 | + </filter> | ||
| 32 | + <!--<File>../logs</File>--> | ||
| 33 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| 34 | + <FileNamePattern>${logdir}/info.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern> | ||
| 35 | + <maxHistory>100</maxHistory> | ||
| 36 | + <totalSizeCap>100MB</totalSizeCap> | ||
| 37 | + </rollingPolicy> | ||
| 38 | + <encoder> | ||
| 39 | + <charset>UTF-8</charset> | ||
| 40 | + <pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern> | ||
| 41 | + </encoder> | ||
| 42 | + </appender> | ||
| 43 | + <!--输出Error级别日志--> | ||
| 44 | + <!--<appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">--> | ||
| 45 | + <!--<filter class="ch.qos.logback.classic.filter.LevelFilter">--> | ||
| 46 | + <!--<!–过滤 Error –>--> | ||
| 47 | + <!--<level>ERROR</level>--> | ||
| 48 | + <!--</filter>--> | ||
| 49 | + <!--<!–<File>../logs</File>–>--> | ||
| 50 | + <!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">--> | ||
| 51 | + <!--<FileNamePattern>${logdir}/error.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern>--> | ||
| 52 | + <!--<maxHistory>100</maxHistory>--> | ||
| 53 | + <!--<totalSizeCap>100MB</totalSizeCap>--> | ||
| 54 | + <!--</rollingPolicy>--> | ||
| 55 | + <!--<encoder>--> | ||
| 56 | + <!--<charset>UTF-8</charset>--> | ||
| 57 | + <!--<pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>--> | ||
| 58 | + <!--</encoder>--> | ||
| 59 | + <!--</appender>--> | ||
| 60 | + <!--监控下列类的所有日志,定义输出级别--> | ||
| 61 | + <logger name="java.sql.PreparedStatement" level="DEBUG" additivity="false"> | ||
| 62 | + <appender-ref ref="consoleLog"/> | ||
| 63 | + </logger> | ||
| 64 | + <logger name="java.sql.Connection" level="DEBUG" additivity="false"> | ||
| 65 | + <appender-ref ref="consoleLog"/> | ||
| 66 | + </logger> | ||
| 67 | + <logger name="java.sql.Statement" level="DEBUG" additivity="false"> | ||
| 68 | + <appender-ref ref="consoleLog"/> | ||
| 69 | + </logger> | ||
| 70 | + <logger name="com.ibatis" level="DEBUG" additivity="false"> | ||
| 71 | + <appender-ref ref="consoleLog"/> | ||
| 72 | + </logger> | ||
| 73 | + <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" additivity="false"> | ||
| 74 | + <appender-ref ref="consoleLog"/> | ||
| 75 | + </logger> | ||
| 76 | + <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" additivity="false"> | ||
| 77 | + <appender-ref ref="consoleLog"/> | ||
| 78 | + </logger> | ||
| 79 | + <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" additivity="false"> | ||
| 80 | + <appender-ref ref="consoleLog"/> | ||
| 81 | + </logger> | ||
| 82 | + <!--输出--> | ||
| 83 | + <root level="INFO"> | ||
| 84 | + <appender-ref ref="consoleLog"/> | ||
| 85 | + <!--<appender-ref ref="consoleLog"/>--> | ||
| 86 | + <appender-ref ref="fileInfoLog"/> | ||
| 87 | + <!--<appender-ref ref="fileErrorLog"/>--> | ||
| 88 | + </root> | ||
| 89 | + | ||
| 90 | +</configuration> | 
pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 3 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 4 | + <modelVersion>4.0.0</modelVersion> | ||
| 5 | + <parent> | ||
| 6 | + <groupId>org.springframework.boot</groupId> | ||
| 7 | + <artifactId>spring-boot-starter-parent</artifactId> | ||
| 8 | + <version>2.1.7.RELEASE</version> | ||
| 9 | + <relativePath/> <!-- lookup parent from repository --> | ||
| 10 | + </parent> | ||
| 11 | + <groupId>com.sunyo.wlpt.cloud.config.server</groupId> | ||
| 12 | + <artifactId>cloud-config-server</artifactId> | ||
| 13 | + <version>0.0.1-SNAPSHOT</version> | ||
| 14 | + <name>cloud-config-server</name> | ||
| 15 | + <description>配置中心</description> | ||
| 16 | + | ||
| 17 | + <properties> | ||
| 18 | + <java.version>1.8</java.version> | ||
| 19 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| 20 | + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| 21 | + <spring-cloud.version>Greenwich.SR2</spring-cloud.version> | ||
| 22 | + </properties> | ||
| 23 | + | ||
| 24 | + <dependencies> | ||
| 25 | + <!-- SpringBoot start --> | ||
| 26 | + <dependency> | ||
| 27 | + <groupId>org.springframework.boot</groupId> | ||
| 28 | + <artifactId>spring-boot-starter</artifactId> | ||
| 29 | + </dependency> | ||
| 30 | + | ||
| 31 | + <dependency> | ||
| 32 | + <groupId>org.springframework.boot</groupId> | ||
| 33 | + <artifactId>spring-boot-starter-web</artifactId> | ||
| 34 | + </dependency> | ||
| 35 | + | ||
| 36 | + <!-- SpringCloud start --> | ||
| 37 | + <dependency> | ||
| 38 | + <groupId>org.springframework.cloud</groupId> | ||
| 39 | + <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> | ||
| 40 | + </dependency> | ||
| 41 | + <dependency> | ||
| 42 | + <groupId>org.springframework.cloud</groupId> | ||
| 43 | + <artifactId>spring-cloud-config-server</artifactId> | ||
| 44 | + </dependency> | ||
| 45 | + <dependency> | ||
| 46 | + <groupId>org.springframework.cloud</groupId> | ||
| 47 | + <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> | ||
| 48 | + </dependency> | ||
| 49 | + <dependency> | ||
| 50 | + <groupId>org.springframework.cloud</groupId> | ||
| 51 | + <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> | ||
| 52 | + </dependency> | ||
| 53 | + | ||
| 54 | + <dependency> | ||
| 55 | + <groupId>org.springframework.cloud</groupId> | ||
| 56 | + <artifactId>spring-cloud-starter-openfeign</artifactId> | ||
| 57 | + </dependency> | ||
| 58 | + | ||
| 59 | + <dependency> | ||
| 60 | + <groupId>org.springframework.cloud</groupId> | ||
| 61 | + <artifactId>spring-cloud-starter-zipkin</artifactId> | ||
| 62 | + </dependency> | ||
| 63 | + | ||
| 64 | + <dependency> | ||
| 65 | + <groupId>de.codecentric</groupId> | ||
| 66 | + <artifactId>spring-boot-admin-starter-client</artifactId> | ||
| 67 | + <version>2.2.0</version> | ||
| 68 | + </dependency> | ||
| 69 | + <dependency> | ||
| 70 | + <groupId>org.springframework.boot</groupId> | ||
| 71 | + <artifactId>spring-boot-starter-actuator</artifactId> | ||
| 72 | + </dependency> | ||
| 73 | + <!-- SpringCloud end --> | ||
| 74 | + | ||
| 75 | + <dependency> | ||
| 76 | + <groupId>org.projectlombok</groupId> | ||
| 77 | + <artifactId>lombok</artifactId> | ||
| 78 | + <optional>true</optional> | ||
| 79 | + </dependency> | ||
| 80 | + | ||
| 81 | + <dependency> | ||
| 82 | + <groupId>log4j</groupId> | ||
| 83 | + <artifactId>log4j</artifactId> | ||
| 84 | + <version>1.2.17</version> | ||
| 85 | + </dependency> | ||
| 86 | + | ||
| 87 | + <!-- test start --> | ||
| 88 | + <dependency> | ||
| 89 | + <groupId>org.springframework.boot</groupId> | ||
| 90 | + <artifactId>spring-boot-starter-test</artifactId> | ||
| 91 | + <scope>test</scope> | ||
| 92 | + <exclusions> | ||
| 93 | + <exclusion> | ||
| 94 | + <groupId>org.junit.vintage</groupId> | ||
| 95 | + <artifactId>junit-vintage-engine</artifactId> | ||
| 96 | + </exclusion> | ||
| 97 | + </exclusions> | ||
| 98 | + </dependency> | ||
| 99 | + <!-- test end --> | ||
| 100 | + </dependencies> | ||
| 101 | + | ||
| 102 | + <dependencyManagement> | ||
| 103 | + <dependencies> | ||
| 104 | + <dependency> | ||
| 105 | + <groupId>org.springframework.cloud</groupId> | ||
| 106 | + <artifactId>spring-cloud-dependencies</artifactId> | ||
| 107 | + <version>${spring-cloud.version}</version> | ||
| 108 | + <type>pom</type> | ||
| 109 | + <scope>import</scope> | ||
| 110 | + </dependency> | ||
| 111 | + </dependencies> | ||
| 112 | + </dependencyManagement> | ||
| 113 | + | ||
| 114 | + <build> | ||
| 115 | + <plugins> | ||
| 116 | + <plugin> | ||
| 117 | + <groupId>org.springframework.boot</groupId> | ||
| 118 | + <artifactId>spring-boot-maven-plugin</artifactId> | ||
| 119 | + <configuration> | ||
| 120 | + <mainClass>com.sunyo.wlpt.cloud.config.server.CloudConfigServerApplication</mainClass> | ||
| 121 | + </configuration> | ||
| 122 | + </plugin> | ||
| 123 | + </plugins> | ||
| 124 | + </build> | ||
| 125 | + | ||
| 126 | + <repositories> | ||
| 127 | + <repository> | ||
| 128 | + <id>spring-snapshots</id> | ||
| 129 | + <name>Spring Snapshots</name> | ||
| 130 | + <url>https://repo.spring.io/snapshot</url> | ||
| 131 | + <snapshots> | ||
| 132 | + <enabled>true</enabled> | ||
| 133 | + </snapshots> | ||
| 134 | + </repository> | ||
| 135 | + <repository> | ||
| 136 | + <id>spring-milestones</id> | ||
| 137 | + <name>Spring Milestones</name> | ||
| 138 | + <url>https://repo.spring.io/milestone</url> | ||
| 139 | + <snapshots> | ||
| 140 | + <enabled>false</enabled> | ||
| 141 | + </snapshots> | ||
| 142 | + </repository> | ||
| 143 | + </repositories> | ||
| 144 | + | ||
| 145 | +</project> | 
| 1 | +package com.sunyo.wlpt.cloud.config.server; | ||
| 2 | + | ||
| 3 | +import org.springframework.boot.SpringApplication; | ||
| 4 | +import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
| 5 | +import org.springframework.cloud.config.server.EnableConfigServer; | ||
| 6 | +import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | ||
| 7 | + | ||
| 8 | +@SpringBootApplication | ||
| 9 | +@EnableConfigServer | ||
| 10 | +@EnableEurekaClient | ||
| 11 | +public class CloudConfigServerApplication { | ||
| 12 | + | ||
| 13 | + public static void main(String[] args) { | ||
| 14 | + SpringApplication.run(CloudConfigServerApplication.class, args); | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | +} | 
- 
请 注册 或 登录 后发表评论
