From 53c66aed6cb7fa3381128d8f24bdad8e00028ae6 Mon Sep 17 00:00:00 2001 From: "Yangkai.Shen" <237497819@qq.com> Date: Tue, 23 Apr 2019 10:09:17 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20spring-boot-demo-graylog=20?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spring-boot-demo-graylog/pom.xml | 8 +- .../graylog/SpringBootDemoGraylogApplication.java | 13 +++ .../src/main/resources/application.properties | 1 - .../src/main/resources/application.yml | 3 + .../src/main/resources/logback-spring.xml | 112 +++++++++++++++++++++ 5 files changed, 135 insertions(+), 2 deletions(-) delete mode 100644 spring-boot-demo-graylog/src/main/resources/application.properties create mode 100644 spring-boot-demo-graylog/src/main/resources/application.yml create mode 100644 spring-boot-demo-graylog/src/main/resources/logback-spring.xml diff --git a/spring-boot-demo-graylog/pom.xml b/spring-boot-demo-graylog/pom.xml index 2e72650..46b64e1 100644 --- a/spring-boot-demo-graylog/pom.xml +++ b/spring-boot-demo-graylog/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-boot-demo-task + spring-boot-demo-graylog 1.0.0-SNAPSHOT jar @@ -33,6 +33,12 @@ spring-boot-starter-test test + + + de.siegmar + logback-gelf + 2.0.0 + diff --git a/spring-boot-demo-graylog/src/main/java/com/xkcoding/graylog/SpringBootDemoGraylogApplication.java b/spring-boot-demo-graylog/src/main/java/com/xkcoding/graylog/SpringBootDemoGraylogApplication.java index 92f5728..e5570ae 100644 --- a/spring-boot-demo-graylog/src/main/java/com/xkcoding/graylog/SpringBootDemoGraylogApplication.java +++ b/spring-boot-demo-graylog/src/main/java/com/xkcoding/graylog/SpringBootDemoGraylogApplication.java @@ -3,6 +3,19 @@ package com.xkcoding.graylog; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +/** + *

+ * 启动器 + *

+ * + * @package: com.xkcoding.graylog + * @description: 启动器 + * @author: yangkai.shen + * @date: Created in 2019-04-23 09:43 + * @copyright: Copyright (c) 2019 + * @version: V1.0 + * @modified: yangkai.shen + */ @SpringBootApplication public class SpringBootDemoGraylogApplication { diff --git a/spring-boot-demo-graylog/src/main/resources/application.properties b/spring-boot-demo-graylog/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/spring-boot-demo-graylog/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/spring-boot-demo-graylog/src/main/resources/application.yml b/spring-boot-demo-graylog/src/main/resources/application.yml new file mode 100644 index 0000000..89e8d8d --- /dev/null +++ b/spring-boot-demo-graylog/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + application: + name: graylog \ No newline at end of file diff --git a/spring-boot-demo-graylog/src/main/resources/logback-spring.xml b/spring-boot-demo-graylog/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..9454c4f --- /dev/null +++ b/spring-boot-demo-graylog/src/main/resources/logback-spring.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + utf8 + + + + + + localhost + 12201 + 508 + true + + true + true + true + false + false + true + + ${GRAY_LOG_SHORT_PATTERN} + + + ${GRAY_LOG_FULL_PATTERN} + + app_name:${APP_NAME} + os_arch:${os.arch} + os_name:${os.name} + os_version:${os.version} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +