Jelajahi Sumber

log 模块没有任何功能, 仅用于测试包含项目依赖后生成的 jar 包文件大小

reghao 6 bulan lalu
induk
melakukan
9dd8b2120c

+ 67 - 0
log/pom.xml

@@ -18,10 +18,77 @@
     </properties>
 
     <dependencies>
+        <dependency>
+            <groupId>cn.reghao.tnb</groupId>
+            <artifactId>common</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+
         <dependency>
             <groupId>com.squareup.okhttp3</groupId>
             <artifactId>okhttp</artifactId>
             <version>4.10.0</version>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <properties>
+                <profile.active>dev</profile.active>
+            </properties>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+        </profile>
+        <profile>
+            <id>test</id>
+            <properties>
+                <profile.active>test</profile.active>
+            </properties>
+        </profile>
+        <profile>
+            <id>cluster</id>
+            <properties>
+                <profile.active>cluster</profile.active>
+            </properties>
+        </profile>
+    </profiles>
+
+    <build>
+        <finalName>tnb-log</finalName>
+        <extensions>
+            <extension>
+                <groupId>kr.motd.maven</groupId>
+                <artifactId>os-maven-plugin</artifactId>
+                <version>1.5.0.Final</version>
+            </extension>
+        </extensions>
+
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>application.yml</include>
+                    <include>application-${profile.active}.yml</include>
+                </includes>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${springboot.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 17 - 0
log/src/main/java/cn/reghao/tnb/log/LogApplication.java

@@ -0,0 +1,17 @@
+package cn.reghao.tnb.log;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+
+/**
+ * @author reghao
+ * @date 2025-08-27 16:38:00
+ */
+@SpringBootApplication
+@ComponentScan({"cn.reghao.tnb.log", "cn.reghao.tnb.common"})
+public class LogApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(LogApplication.class, args);
+    }
+}

+ 1 - 1
log/src/main/java/cn/reghao/tnb/log/WsAppender.java → log/src/main/java/cn/reghao/tnb/log/appender/WsAppender.java

@@ -1,4 +1,4 @@
-package cn.reghao.tnb.log;
+package cn.reghao.tnb.log.appender;
 
 import ch.qos.logback.classic.spi.ILoggingEvent;
 import ch.qos.logback.core.UnsynchronizedAppenderBase;

+ 31 - 0
log/src/main/resources/application.yml

@@ -0,0 +1,31 @@
+dubbo:
+  application:
+    name: log-service
+    qos-enable: true
+    qos-port: 28080
+    qos-accept-foreign-ip: false
+  scan:
+    base-packages: cn.reghao.tnb.file.app.rpc
+  protocol:
+    name: dubbo
+    port: 18080
+  registry:
+    address: zookeeper://localhost:2181
+server:
+  port: 8080
+  tomcat:
+    max-http-form-post-size: 4MB
+spring:
+  application:
+    name: log-service
+  profiles:
+    active: @profile.active@
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+eureka:
+  instance:
+    prefer-ip-address: true
+  client:
+    register-with-eureka: true
+    fetch-registry: true