Plantre Plantre
首页
后端
技术
硬件
  • 前端文章

    • HTML
    • CSS
    • JavaScript
  • 技术

    • 技术文档
    • GitHub技巧
    • Nodejs
    • 博客搭建
  • 学习笔记

    • 《JavaScript教程》
    • 《JavaScript高级程序设计》
    • 《ES6 教程》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • 《Git》
    • TypeScript
    • JS设计模式总结
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
关于
收藏
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

plantre

一个后端开发者
首页
后端
技术
硬件
  • 前端文章

    • HTML
    • CSS
    • JavaScript
  • 技术

    • 技术文档
    • GitHub技巧
    • Nodejs
    • 博客搭建
  • 学习笔记

    • 《JavaScript教程》
    • 《JavaScript高级程序设计》
    • 《ES6 教程》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • 《Git》
    • TypeScript
    • JS设计模式总结
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
关于
收藏
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 计算机组成原理

  • 操作系统

  • 计算机网络

  • 设计模式

  • Java

  • Spring

    • Spring 事务
    • Spring Boot自动装配基于SPI实现的吗
    • SpringBoot自动装配是什么
    • MyBatis插入数据后回填id
    • springboot2.5.15整合prometheus
    • 集成loki
      • logback.xml
      • pom
  • SpringCloud

  • MySQL

  • Redis

  • 分布式

  • Zookeeper

  • Dubbo

  • Kafka

  • 数据结构

  • 算法

  • OJ

  • 从道家哲学看计算机?
  • 后端
  • Spring
plantre
2025-07-04
目录

集成loki

# logback.xml

   <!-- Loki输出器 -->
    <appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
            <http>
                <url>http://10.143.143.102:33100/loki/api/v1/push</url>
            </http>
            <format>
                <label>
                    <pattern>application=${name},level=%level</pattern>
                    <readMarkers>true</readMarkers>
                </label>
                <message>
                    <pattern>
                        {"timestamp": "%d{yyyy-MM-dd HH:mm:ss.SSS}", "level": "%level", "logger": "%logger{36}.%method", "method":"%M", "line":"%line", "thread": "%thread", "message": "%msg%n"}
                    </pattern>
                </message>
                <sortByTime>true</sortByTime>
            </format>
    </appender>
    
    <root level="info">
		<appender-ref ref="console" />
        <appender-ref ref="LOKI" />
	</root>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

# pom

<dependency>
            <groupId>com.github.loki4j</groupId>
            <artifactId>loki-logback-appender</artifactId>
            <version>1.4.1</version>
        </dependency>
1
2
3
4
5
编辑 (opens new window)
springboot2.5.15整合prometheus
Spring Cloud生态

← springboot2.5.15整合prometheus Spring Cloud生态→

最近更新
01
TCP的ESTABLISHED是什么意思
06-24
02
安装1panel
06-24
03
​​Dubbo和SpringCloud适用场景
06-24
更多文章>
Theme by Vdoing | Copyright © 2025-2025 plantre | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式