【Springboot总结】10 Springboot日志

2026软考系统集成项目管理工程师第三版300集精讲课程备考指南 项目管理是IT从业者职业进阶的核心能力之一,软考中级“系统集成项目管理工程师”作为国家级资格认证,其知识体系涵盖信息化技术、项目管理过程组、法律法规等多维度内容。针对第三版教材启用后的考纲变化,备考需以官方教程为主线,辅以体系化视频课程与高频刷题训练。在实践场景中,考生常借助“软考刷题app哪个好”、“软考题库在线刷题”等工具提升效率,但关键在于理解概念原理,例如项目管理十大知识领域与五大过程组的映射关系。从技术价值看,该证书可用于职称评定、企业资质与落户加分,应用场景覆盖转岗晋升与个人能力证明。围绕202 阅读详情

重点掌握默认的日志的使用与配置,一般不会随意切换日志!

 

一、Springboot日志关系

1. pom.xml

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-logging</artifactId>
</dependency>

2. 底层依赖的关系

 

总结

​ 1)、SpringBoot底层也是使用slf4j+logback的方式进行日志记录

​ 2)、SpringBoot也把其他的日志都替换成了slf4j;

​ 3)、中间替换包

4)、如果我们要引入其他框架?一定要把这个框架的默认日志依赖移除掉

         Spring框架用的是commons-logging

<dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-core</artifactId>
	<exclusions>
		<exclusion>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
		</exclusion>
	</exclusions>
</dependency>

SpringBoot能自动适配所有的日志,而且底层使用slf4j+logback的方式记录日志,引入其他框架的时候,只需要把这个框架依赖的日志框架排除掉即可;

 

二、日志的使用

 

1. 默认配置

(1)SpringBoot默认帮我们配置好了日志

//记录器
	Logger logger = LoggerFactory.getLogger(getClass());
	@Test
	public void contextLoads() {
		//System.out.println();

		//日志的级别;
		//由低到高   trace<debug<info<warn<error
		//可以调整输出的日志级别;日志就只会在这个级别以以后的高级别生效
		logger.trace("这是trace日志...");
		logger.debug("这是debug日志...");

		//SpringBoot默认给我们使用的是info级别的
		logger.info("这是info日志...");
		logger.warn("这是warn日志...");
		logger.error("这是error日志...");


	}

(2) 日志的输出格式

    日志输出格式:
		%d表示日期时间,
		%thread表示线程名,
		%-5level:级别从左显示5个字符宽度
		%logger{50} 表示logger名字最长50个字符,否则按照句点分割。 
		%msg:日志消息,
		%n是换行符
    -->
    %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n

(3)在application.properties中修改默认配置

#修改日志级别
logging.level.com.atguigu=trace


#logging.path=springboot.log
# 不指定路径在当前项目下生成springboot.log日志

# 可以指定完整的路径;
#logging.file=G:/springboot.log

# 在当前磁盘的根路径下创建spring文件夹和里面的log文件夹;使用 spring.log 作为默认文件
logging.path=/spring/log

#  在控制台输出的日志的格式
logging.pattern.console=%d{yyyy-MM-dd} [%thread] %-5level %logger{50} - %msg%n

# 指定文件中日志输出的格式
logging.pattern.file=%d{yyyy-MM-dd} === [%thread] === %-5level === %logger{50} ==== %msg%n

【提示】logging.path与logging.file是冲突的。一般建议直接配置loggging.path,因为日志文件的名字springboot会自定义,不需要手动指定!

 

2. 指定配置

给类路径下放上每个日志框架自己的配置文件即可;SpringBoot就不使用他默认配置的了

Logging SystemCustomization
Logbacklogback-spring.xml, logback-spring.groovy, logback.xml or logback.groovy
Log4j2log4j2-spring.xml or log4j2.xml
JDK (Java Util Logging)logging.properties

logback.xml:直接就被日志框架识别了;

logback-spring.xml:日志框架就不直接加载日志的配置项,由SpringBoot解析日志配置,可以使用SpringBoot的高级Profile功能

<springProfile name="staging">
    <!-- configuration to be enabled when the "staging" profile is active -->
  	可以指定某段配置只在某个环境下生效
</springProfile>

如:

<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
        <!--
        日志输出格式:
			%d表示日期时间,
			%thread表示线程名,
			%-5level:级别从左显示5个字符宽度
			%logger{50} 表示logger名字最长50个字符,否则按照句点分割。 
			%msg:日志消息,
			%n是换行符
        -->
        <layout class="ch.qos.logback.classic.PatternLayout">
            <springProfile name="dev">
                <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ----> [%thread] ---> %-5level %logger{50} - %msg%n</pattern>
            </springProfile>
            <springProfile name="!dev">
                <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} ==== [%thread] ==== %-5level %logger{50} - %msg%n</pattern>
            </springProfile>
        </layout>
    </appender>

【提示】上述配置规定了不同环境下日志的输出格式!

如果使用logback.xml作为日志配置文件,还要使用profile功能,会有以下错误

no applicable action for [springProfile]

 

三、切换日志框架

可以按照slf4j的日志适配图,进行相关的切换;

切换为log4j2

   <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>spring-boot-starter-logging</artifactId>
                    <groupId>org.springframework.boot</groupId>
                </exclusion>
            </exclusions>
        </dependency>

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>

切换之后可以在类路径下添加log4j.xml配置文件,规定相关的日志配置!

Log4j2log4j2-spring.xml or log4j2.xml
自动驾驶关键技术(一):时间敏感网络TSN 时间敏感网络TSN的基本概念、协议族介绍和开发流程。 阅读详情

相关推荐

HALCON基于描述符的模板匹配(未标定)

HALCON基于不标定描述符的模板匹配

king_linj的博客 893

spring boot 中使用log

一、spring boot的默认log 默认log是logback二、spring boot中启用log4j 参考样例是gradle工程configurations { //排除默认log compile.exclude group:'ch.qos.logback' } dependencies { //启用log4j runtime('org.springframework.b

biggo1的博客 1276

别再让PyCharm吃光你的C盘!保姆级教程:安全迁移config、plugins和remote sources到D盘

本文提供了一份详细的PyCharm配置与缓存文件迁移指南,帮助开发者将config、plugins和remote sources等占用大量C盘空间的文件安全转移到D盘。通过修改data.properties文件和正确迁移顺序,确保PyCharm功能不受影响,同时释放宝贵的系统盘空间。

weixin_28836989的博客 424

Spring Boot中正确使用Log的详细总结

Spring Boot中正确使用Log的详细总结 1. 概要 在本文中我们将总结Spring Boot中可用的主要日志框架的使用和配置。 Spring Boot内部模块都使用Commons Logging来记录日志,但是底层日志框架是可以替换的,支持的日志框架有:Java Util Logging 、Log4J2和Logback并为上述框架提供了默认配置。在默认情况下,日志记录器都预先配置为使用控制台输出,同时还提供可选的文件输出。 通常,当项目中使用Spring boot Starters 时,Logba

kerongao的博客 1万+

CST 2023安装避坑指南:从下载到破解的完整流程(附常见报错解决方案)

本文提供CST 2023三维全波电磁场仿真软件的完整安装指南,涵盖从下载到破解的全流程,并附常见报错解决方案。详细解析安装步骤、许可证配置优化及高频问题诊断,帮助用户快速部署并优化软件性能,适用于射频电路设计、天线优化等场景。

7z8x2c4v6b9的博客 659

FPGA实战:手把手教你实现VESA DSC编码(附Verilog代码解析)

本文详细介绍了如何使用FPGA实现VESA DSC编码器,包括核心架构设计、Verilog代码实现与优化技巧。通过流水线设计、色彩空间转换和预测编码等关键技术,帮助开发者掌握工业级DSC编码器的开发流程,并提供实用的调试与性能优化方法。

weixin_29165725的博客 408

SpringBoot配置统一日志

1.添加依赖jar <!--集成logstash--> <dependency> <groupId>net.logstash.logback</groupId> <artifactId>logstash-logback-encoder</artifactId> <version>4.8&...

zhangshengqiang168的博客 1000

SwarmClaw:自托管多智能体AI运行时部署与实战指南

多智能体系统是人工智能领域的重要发展方向,它通过多个具备自主决策和协作能力的智能体共同完成任务,其核心原理在于分布式问题求解与协同规划。这种架构在提升任务处理效率、复杂问题分解和鲁棒性方面具有显著技术价值,广泛应用于自动化工作流、虚拟团队协作、智能客服和个性化助手等场景。本文聚焦于SwarmClaw这一自托管的多智能体AI运行时,它原生支持Model Context Protocol,并内置了超过23种AI提供商,为开发者提供了一个开箱即用且高度可定制的控制平面,便于构建和管理复杂的多智能体协作网络。

weixin_27207591的博客 403

spring-boot项目基础-logging

市面上的日志框架 市面上的日志框架有以下几种: jcl、slf4j、jboss-logging、log4j、jul、log4j2、logback 日志门面(日志抽象层) 日志实现 jcl(jakarta commons loggingapache jakarta小组开发的)slf4j(simple logging facade for java)jboss-logging log4jjul(java.util.logging)log4j2logback 日志选择描述: 从上表左边

blinking_cursor_I 296

国密(3)- 预主密钥/主密钥计算和Finished消息的加解密

国密的ECC-SM3-SM4-CBC模式下的预主密钥和主密钥的生成过程介绍,以及Finished消息的加解密介绍

weixin_43408952的博客 6517

【Bug已解决】codex: debug 模式无输出 — CodeX CLI 调试模式不工作解决方案

CodeX CLI 开启 debug 模式后无输出/日志不打印的解决方案,含 debug 开关、日志级别、stderr 重定向与 IDE 日志面板。

一键难忘的博客 4165

Springboot Logging的配置以及使用详解

Springboot使用Commons Logging作为内部的日志系统,并且给Java Util Logging,Log4J2以及Logback都提供了默认的配置。 如果使用了spring boot的Starters,那么默认会使用Logback用于记录日志。 一、Log format spring boot中默认的日志输出格式如下: 2014-03-05 10:57:51.112 I...

levae1024的博客 1万+

实战封神!YOLOv7 轻量化部署全攻略:ONNX格式转换+TensorRT极致加速(速度直接提升3-5倍,精度无损)

部署核心链路,这是YOLO系列部署的最优解,速度提升3~5倍,精度无损;ONNX是桥梁:解决模型兼容性问题,简化后能去掉冗余节点,是TensorRT加速的前提;TensorRT是核心:NVIDIA显卡的极致加速引擎,FP16量化是速度与精度的最优平衡,无需手动配置,一键开启;轻量化终极组合YOLOv7-tiny + 416尺寸 + TensorRT FP16,速度提升5~8倍,满足所有实时检测场景;避坑核心:转换参数必加,推理尺寸必须一致,engine文件显卡专属。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 308

springboot 日志级别_Spring Boot 10 记录日志

“日志”简单地理解为“记录”应用程序运行期间的问题。这里的问题是错误,警告和其他信息,…此信息可以显示在控制台屏幕上或记录在日志文件中。当您直接在eclipse上运行spring boot应用程序时,您可以在控制台窗口上看到信息。此信息显示应用程序的状态,运行应用程序期间发生的错误。那是日志记录!有许多不同的日志库,如logback、log4j2、jul、…,spring boot可以使用这些库。...

weixin_39683241的博客 229

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

springboot学习日志之DAY10日志配置

SpringBoot之日志配置 springboot日志配置文档介绍: 官方文档地址:https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html 国内大神翻译的中文文档:https://blog.youkuaiyun.com/Quincunti...

光滑的秃头 265

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

从零开始 Spring Boot 10:日志

从零开始 Spring Boot 10:日志 图源:简书 (jianshu.com) 虽然可以通过System.out.println之类的方式向控制台直接输出一些信息进行最简单的调试,但这种方式并不正式,且很难将输出信息收集和统一管理分析。 正式的方式是使用日志,实际上很多编程语言甚至提供语言层级的日志支持,不过Java并没有相应的支持,需要我们选取一些适用于Spring Boot应用的日志框架。 事实上Spring Boot默认提供了对Logback日志框架的支持,但在实际使用中更多的是使用SLF4J

梦幻天空 286

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

【Spring Boot】(10)、Spring Boot日志框架

1、日志框架市面上的日志框架:JUL、JCL、Jboss-logging、logback、log4j、log4j2、slf4j...日志门面(日志的抽象层)日志的实现层JCL(Jakarta Common logging)---Apache常用的common-logging、SLF4j(Simple Logging Facade for Java)、jboss-loggingLog4j、Log4j...

caychen的博客 1224

window10安装ELK8并记录springboot日志

下载Elastic产品|Elastic免费下载Elasticsearch、Logstash、Kibana和Beats,分分钟上手使用ElasticAPM、ElasticAppSearch、ElasticWorkplaceSearch等服务。https修改elasticsearch.yml文件启动双击elasticsearch.bat首次启动控制台会出现账号密码将账号密码保存到elasticsearch.yml中,防止以后忘记()访问。..............................

Good Luck 1275

【SpringBoot】10 日志持久化(log4j2)

介绍日志的分类,日志门面和日志实现。将SpringBoot默认的Logback日志实现框架替换为Log4j2,并实现日志的持久化,按时间或日志文件大小切分日志文件,并归档入当天的目录中。

寻道书生的博客 1328

10年开发经验竟不懂SpringBoot日志

因公众号更改推送规则,请点“在看”并加“星标”第一时间获取精彩技术分享点击关注#互联网架构师公众号,领取架构师全套资料 都在这里0、2T架构师学习资料干货分上一篇:2T架构师学习资料干货分享大家好,我是互联网架构师!前言日志,是开发中熟悉又陌生的伙伴,熟悉是因为我们经常会在各种场合打印日志,陌生是因为大部分时候我们都不太关心日志是怎么打印出来的,因为打印一条日志,在我们看来是一件太平常不过的事情了...

emprere的博客 101

SpringBoot学习笔记(10)——日志

1、日志框架 写了一个统一的接口层;日志门面(日志的一个抽象层);logging-abstract.jar; 给项目中导入具体的日志实现就行了;我们之前的日志框架都是实现的抽象层; 左边选一个门面(抽象层)、右边来选一个实现; 日志门面: SLF4J; 日志实现:Logback; SpringBoot:底层是Spring框架,Spring框架默认是用JCL;‘ Spri...

yangwei256的博客 187

SpringBoot10-日志级别及配置

使用前提 1.直接定义一个final变量 ,后面的字节码类是你当前使用日志辅助的类 private static final Logger log = LoggerFactory.getLogger(MyController.class); 2.在有lombok插件的前提下,可以直接在类上贴上注解@Slf4j 即可使用log变量 使用配置 在yml文件中可以有如下配置, logg...

545

SpringBoot学习笔记10 - 控制日志输出

1、说明 Spring Boot中使用的日志技术为logback。其与Log4J出自一人,其性能优于Log4J,是Log4J的替代者。 2、添加依赖 在Spring Boot中使用 logback,需要具有spring-boot-starter-logging依赖,而该依赖被spring-boot-starter-web所依赖,即不用直接导入spring-boot-starter-logging依赖。 3、方式1: 在application.yml中配置属性 # logback日志控制 logg

weixin_39997438的博客 301

springboot(10)日志记录

1、配置 springboot默认使用logback日志框架。 在src/main/resources路径下创建logback.xml文件,模板见2。springboot则会自动读取该配置文件并启动logback日志框架。 2、配置文件 configuration debug=&amp;amp;amp;quot;false&amp;amp;amp;quot;&amp;amp;amp;gt; property name=&amp;amp;amp;qu

祈雨v的博客 702

SpringBoot整合ELK日志中心(WIN10)

参考连接:https://www.jianshu.com/p/97fcb10c3556 ELK 是 elastic 公司旗下三款产品 ElasticSearch 、Logstash 、Kibana 的首字母组合。 ElasticSearch 是一个基于 Lucene 构建的开源,分布式,RESTful 搜索引擎。 Logstash 传输和处理你的日志、事务或其他数据。 Kibana 将 Elasticsearch 的数据分析并渲染为可视化的报表。 注意: 本文ELK使用6.8.0版本, .

撑到最后,才有然后 523

2024.10.27- SpringBoot整合Mybatis和日志框架

mysql依赖。

whisper_Java 的博客 1390
上一篇: 【Springboot总结】9. 日志
下一篇: 【Springboot总结】日志文件logback.xml
Rita楠神
博客等级 码龄9年 27粉丝 61原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值