mirror of
https://github.com/mfish-qf/mfish-nocode.git
synced 2026-09-01 15:09:52 +08:00
feat: 增加服务监控
This commit is contained in:
@@ -19,3 +19,4 @@
|
||||
/mf-oauth/logs/
|
||||
/storage/
|
||||
/mf-storage/target/
|
||||
/mf-monitor/target/
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>mfish-nocode</artifactId>
|
||||
<groupId>cn.com.mfish</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>mf-monitor</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.com.mfish</groupId>
|
||||
<artifactId>mf-common-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.com.mfish.monitor;
|
||||
|
||||
import cn.com.mfish.common.web.annotation.AutoWeb;
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
||||
/**
|
||||
* @description: 摸鱼监控中心启动类
|
||||
* @author: mfish
|
||||
* @date: 2023/1/26 23:11
|
||||
*/
|
||||
@AutoWeb
|
||||
@EnableAdminServer
|
||||
@Slf4j
|
||||
public class MfMonitorApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MfMonitorApplication.class, args);
|
||||
log.info("\n\t----------------------------------------------------------\n\t" +
|
||||
"\n\t--------------------摸鱼监控中心启动成功-----------------------\n\t");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
Application Name: ${spring.application.name}
|
||||
Application Version: ${mfish.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
|
||||
___ _ __ _ _
|
||||
.' ..](_) [ | (_) / |_
|
||||
_ .--..--. _| |_ __ .--. | |--. ______ _ .--..--. .--. _ .--. __ `| |-' .--. _ .--.
|
||||
[ `.-. .-. |'-| |-'[ | ( (`\] | .-. ||______|[ `.-. .-. |/ .'`\ \[ `.-. | [ | | | / .'`\ \[ `/'`\]
|
||||
| | | | | | | | | | `'.'. | | | | | | | | | || \__. | | | | | | | | |,| \__. | | |
|
||||
[___||__||__][___] [___][\__) )[___]|__] [___||__||__]'.__.' [___||__][___]\__/ '.__.' [___]
|
||||
|
||||
██▀▀▀▀▀▀▀██▀██▀█▀▀██▀▀▀▀▀▀▀██
|
||||
██ █▀▀▀█ █▀▀ ▄ ██ ██ █▀▀▀█ ██
|
||||
██ █ █ ██▄ ▄█▀ ▀▀█ █ █ ██
|
||||
██ ▀▀▀▀▀ █▀▄▀█▀█ ▄▀█ ▀▀▀▀▀ ██
|
||||
█m▀▀▀█▀▀▀▀ ▄ ▀▄ ▄ ▀▀▀███▀██m█
|
||||
█f▄▄▄▀ █▀▀█▀▄▄████▄▀ ▀██▀▀ f█
|
||||
█i▄ ▄ █▀▀ ███▄▀ ███ ▀█▀█ ▀i█
|
||||
█s▀█ ▀▄ ▀ ▄ █ ▀██▄ ▄▀█▄▀▀ s█
|
||||
█h▀▄▄▄ ▄▀ ▄▄█▀▄ █ ▀ ▀▀ █▄█h█
|
||||
██▀▀▀▀▀▀▀█ ▀ ▄█ ▀ █▀█ ▄▄ ██
|
||||
██ █▀▀▀█ █ █▀▄▀ ▄█ ▀▀▀ ▄█▀ ██
|
||||
██ █ █ █▀ ▄ ▀█ ██▀ ▀▄█▀██
|
||||
██ ▀▀▀▀▀ █ █▀▀ ▄▀ ▀ ▀▄▄█ ▀██
|
||||
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
@@ -0,0 +1,28 @@
|
||||
mfish:
|
||||
version: 1.0.0
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9223
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: mf-monitor
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: localhost:19014
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: localhost:19014
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs[0]:
|
||||
data-id: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
refresh: true
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<springProperty name="rootLevel" source="log.level" />
|
||||
<springProperty name="maxFileSize" source="log.maxSize" />
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/mf-monitor"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
<maxFileSize>${maxFileSize}</maxFileSize>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_sql" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sql.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sql.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
<maxFileSize>${maxFileSize}</maxFileSize>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
<maxFileSize>${maxFileSize}</maxFileSize>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="cn.com.mfish" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
<!--数据库操作日志-->
|
||||
<logger name="cn.com.mfish.monitor.mapper" level="debug" additivity="true">
|
||||
<appender-ref ref="file_sql"/>
|
||||
</logger>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="${rootLevel}">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -0,0 +1,11 @@
|
||||
swagger:
|
||||
title: '摸鱼监控中心'
|
||||
spring:
|
||||
security:
|
||||
user:
|
||||
name: mfish
|
||||
password: 123456
|
||||
boot:
|
||||
admin:
|
||||
ui:
|
||||
title: 摸鱼监控中心
|
||||
@@ -16,6 +16,7 @@
|
||||
<module>mf-code-create</module>
|
||||
<module>mf-api</module>
|
||||
<module>mf-storage</module>
|
||||
<module>mf-monitor</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
@@ -25,22 +26,22 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-boot.version>2.7.3</spring-boot.version>
|
||||
<spring-cloud.version>2021.0.4</spring-cloud.version>
|
||||
<spring-boot.version>2.7.7</spring-boot.version>
|
||||
<spring-boot-admin.version>2.7.10</spring-boot-admin.version>
|
||||
<spring-cloud.version>2021.0.5</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version>
|
||||
<alibaba.nacos.version>2.2.0</alibaba.nacos.version>
|
||||
<mybatis-plus.version>3.5.2</mybatis-plus.version>
|
||||
<swagger.fox.version>3.0.0</swagger.fox.version>
|
||||
<swagger.core.version>1.6.2</swagger.core.version>
|
||||
<tobato.version>1.27.2</tobato.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<pagehelper.boot.version>1.4.5</pagehelper.boot.version>
|
||||
<druid.version>1.2.12</druid.version>
|
||||
<pagehelper.boot.version>1.4.6</pagehelper.boot.version>
|
||||
<druid.version>1.2.15</druid.version>
|
||||
<dynamic-ds.version>3.5.2</dynamic-ds.version>
|
||||
<commons.io.version>2.11.0</commons.io.version>
|
||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||
<freemarker.version>2.3.31</freemarker.version>
|
||||
<fastjson.version>2.0.15</fastjson.version>
|
||||
<fastjson.version>2.0.22</fastjson.version>
|
||||
<minio.version>8.2.2</minio.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
@@ -111,11 +112,10 @@
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
</dependency>
|
||||
<!-- FastDFS 分布式文件系统 -->
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
<version>${tobato.version}</version>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mybatis 依赖配置 -->
|
||||
|
||||
Reference in New Issue
Block a user