Commit b773b316 by wangguangchao

init

parent 5f8d75e2
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>eureka-server</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
<version>3.0.5</version>
<exclusions>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.5.12</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<repositories>
<repository>
<id>brilliance-virtual</id>
<name>brilliance-virtual</name>
<url>http://114.115.138.98:9620/artifactory/is-hk-virtual/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.12.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.brilliance.hk;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
/**
* @author wangguangchao
* @create 2023-08-11 14:48
*/
@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaServerApplication.class, args);
}
}
# 给当前服务取一个名字
spring.application.name=eureka
# 设置端口号
server.port=8761
logging.config=classpath:logback.xml
# Eureka Server 也是一个普通的微服务,所以当它还是一个注册中心的时候,他会有两层身份:1.注册中心;2.普通服务。
# 默认情况下,会把自己注册到自己上面来,设置为 false 时,表示当前项目不要注册到注册中心上
eureka.client.register-with-eureka=false
# 表示是否从 Eureka Server 上获取注册信息
eureka.client.fetch-registry=false
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 定义log文件的目录 -->
<property name="LOG_HOME" value="logs/eureka"></property>
<property name="maxFileSize" value="50MB"></property>
<property name="charset" value="UTF-8"></property>
<property name="immediateFlush" value="true"></property>
<property name="pattern"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight(%-6level) --- [%15.15(%thread)] %cyan(%-40.40(%logger{40})) : %msg%n"></property>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!-- %.-1level 只显示信息级别的首字母,%-5level 左对齐显示信息级别全称 -->
<pattern>${pattern}</pattern>
</encoder>
</appender>
<appender name="INFO_FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/info.log</file>
<append>true</append>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_HOME}/logs/info.%d{yyyy-MM-dd}.%i.log.zip
</fileNamePattern>
<maxFileSize>${maxFileSize}</maxFileSize>
</rollingPolicy>
<encoder>
<pattern>${pattern}</pattern>
<charset>${charset}</charset>
<immediateFlush>${immediateFlush}</immediateFlush>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 异步输出 -->
<appender name="INFO_FILE_ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>8192</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="INFO_FILE" />
</appender>
<appender name="DEBUG_FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/debug.log</file>
<append>true</append>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_HOME}/logs/debug.%d{yyyy-MM-dd}.%i.log.zip
</fileNamePattern>
<maxFileSize>${maxFileSize}</maxFileSize>
</rollingPolicy>
<encoder>
<pattern>${pattern}</pattern>
<charset>${charset}</charset>
<immediateFlush>${immediateFlush}</immediateFlush>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>DEBUG</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 异步输出 -->
<appender name="DEBUG_FILE_ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>8192</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="DEBUG_FILE" />
</appender>
<appender name="ERROR_FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/error.log</file>
<append>true</append>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_HOME}/logs/error.%d{yyyy-MM-dd}.%i.log.zip
</fileNamePattern>
<maxFileSize>${maxFileSize}</maxFileSize>
</rollingPolicy>
<encoder>
<pattern>${pattern}</pattern>
<charset>${charset}</charset>
<immediateFlush>${immediateFlush}</immediateFlush>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 异步输出 -->
<appender name="ERROR_FILE_ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>8192</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="ERROR_FILE" />
</appender>
<logger name="com.apache.ibatis" level="TRACE" />
<logger name="java.sql.Connection" level="DEBUG" />
<logger name="java.sql.Statement" level="DEBUG" />
<logger name="org.springframework.web" level="INFO"/>
<logger name="com.brilliance" level="DEBUG" />
<logger name="com.ceb" level="DEBUG" />
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="INFO_FILE_ASYNC" />
<appender-ref ref="DEBUG_FILE_ASYNC" />
<appender-ref ref="ERROR_FILE_ASYNC" />
</root>
</configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment