解锁新技能《logback packagingData属性配置作用及源码分析》

开源SDK:

<dependency><groupId>io.github.mingyang66</groupId><artifactId>oceansky-logger</artifactId><version>4.3.6</version>
</dependency>  
<!-- 基于logback的日志组件SDK -->
<dependency><groupId>io.github.mingyang66</groupId><artifactId>emily-spring-boot-logger</artifactId><version>4.3.6</version>
</dependency>

在logback日志的xml配置文件中经常可以看到如下配置:

<configuration scan="true" scanPeriod="60000" debug="false" packagingData="false">

其中packagingData的默认值是false,这个属性会有何作用,对日志打印有何影戏?

一、logback-classic包中的ConfigurationAction类对Configuration配置属性进行读取
    static final String INTERNAL_DEBUG_ATTR = "debug";static final String PACKAGING_DATA_ATTR = "packagingData";static final String SCAN_ATTR = "scan";static final String SCAN_PERIOD_ATTR = "scanPeriod";static final String DEBUG_SYSTEM_PROPERTY_KEY = "logback.debug";long threshold = 0;public void begin(InterpretationContext ic, String name, Attributes attributes) {...LoggerContext lc = (LoggerContext) context;//读取packagingData属性配置boolean packagingData = OptionHelper.toBoolean(ic.subst(attributes.getValue(PACKAGING_DATA_ATTR)), LoggerContext.DEFAULT_PACKAGING_DATA);//设置属性lc.setPackagingDataEnabled(packagingData);if (EnvUtil.isGroovyAvailable()) {ContextUtil contextUtil = new ContextUtil(context);contextUtil.addGroovyPackages(lc.getFrameworkPackages());}// the context is turbo filter attachable, so it is pushed on top of the// stackic.pushObject(getContext());}

此处会将从配置文件中读取到的属性值设置到Context上下文之中;而setPackagingDataEnabled方法又是LoggerContext类中的一个方法,LoggerContext类中还存在一个读取packingData属性的方法isPackagingDataEnabled;

二、isPackagingDataEnabled方法调用处理类

经追踪可以发现isPackagingDataEnabled方法会被EnsureExceptionHandling类的process方法调用

    public void process(Context context, Converter<ILoggingEvent> head) {if (head == null) {// this should never happenthrow new IllegalArgumentException("cannot process empty chain");}if (!chainHandlesThrowable(head)) {Converter<ILoggingEvent> tail = ConverterUtil.findTail(head);Converter<ILoggingEvent> exConverter = null;LoggerContext loggerContext = (LoggerContext) context;if (loggerContext.isPackagingDataEnabled()) {exConverter = new ExtendedThrowableProxyConverter();} else {exConverter = new ThrowableProxyConverter();}tail.setNext(exConverter);}}

我们会发现如果packingData属性被设置为true的时候会new一个ExtendedThrowableProxyConverter类的实例对象,否则就是ThrowableProxyConverter类的实例对象;

三、ExtendedThrowableProxyConverter和ThrowableProxyConverter的区别

public class ExtendedThrowableProxyConverter extends ThrowableProxyConverter {@Overrideprotected void extraData(StringBuilder builder, StackTraceElementProxy step) {ThrowableProxyUtil.subjoinPackagingData(builder, step);}protected void prepareLoggingEvent(ILoggingEvent event) {}}

看过ExtendedThrowableProxyConverter的源码后你会清楚的了解到ExtendedThrowableProxyConverter类是ThrowableProxyConverter的子类;其唯一不同点就是实现了extraData方法的实现;

ThrowableProxyConverter类中extraData方法调用入口:

    private void printStackLine(StringBuilder buf, int ignoredCount, StackTraceElementProxy element) {buf.append(element);extraData(buf, element); // allow other data to be addedif (ignoredCount > 0) {printIgnoredCount(buf, ignoredCount);}}

看到这里清除ExtendedThrowableProxyConverter类实现方法的不同点了吗?它会在每一行打印的堆栈后面添加上自己指定的字符串,具体添加什么字符串后面我们接着看。

四、ExtendedThrowableProxyConverter类在每行堆栈后面添加了哪些内容

public class ExtendedThrowableProxyConverter extends ThrowableProxyConverter {@Overrideprotected void extraData(StringBuilder builder, StackTraceElementProxy step) {ThrowableProxyUtil.subjoinPackagingData(builder, step);}protected void prepareLoggingEvent(ILoggingEvent event) {}}

在每行堆栈后面添加额外信息的实现是在ThrowableProxyUtil.subjoinPackagingData方法中实现;

    public static void subjoinPackagingData(StringBuilder builder, StackTraceElementProxy step) {if (step != null) {ClassPackagingData cpd = step.getClassPackagingData();if (cpd != null) {if (!cpd.isExact()) {builder.append(" ~[");} else {builder.append(" [");}builder.append(cpd.getCodeLocation()).append(':').append(cpd.getVersion()).append(']');}}}

看到这段代码就明白了了吧,会在堆栈每一行后面添加一个左中括号和右中括号,内部填充类所属的包;

五、打印案例

  • packingData为true
2023-07-17 13:17:04.483 ERROR default --- [tp-nio-8080-exec-2] c.e.i.t.controller.LogbackController:35   : -----error test---- 
java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is nullat com.emily.infrastructure.test.controller.LogbackController.debug(LogbackController.java:33) ~[classes/:na]at com.emily.infrastructure.test.controller.LogbackController$$FastClassBySpringCGLIB$$2de19373.invoke(<generated>) ~[classes/:na]at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.28.jar:5.3.28]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.28.jar:5.3.28]at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.28.jar:5.3.28]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.28.jar:5.3.28]at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:70) ~[druid-1.2.18.jar:na]at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.28.jar:5.3.28]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.28.jar:5.3.28]at com.emily.infrastructure.autoconfigure.request.interceptor.DefaultRequestMethodInterceptor.invoke(DefaultRequestMethodInterceptor.java:64) ~[classes/:na]at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) ~[spring-aop-5.3.28.jar:5.3.28]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.28.jar:5.3.28]at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.28.jar:5.3.28]at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.28.jar:5.3.28]at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.28.jar:5.3.28]at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.28.jar:5.3.28]at com.emily.infrastructure.test.controller.LogbackController$$EnhancerBySpringCGLIB$$5379665.debug(<generated>) ~[classes/:na]at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.28.jar:5.3.28]at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.28.jar:5.3.28]at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.28.jar:5.3.28]at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.28.jar:5.3.28]at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.28.jar:5.3.28]at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.28.jar:5.3.28]at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.28.jar:5.3.28]at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.28.jar:5.3.28]at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.28.jar:5.3.28]at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.28.jar:5.3.28]
  • packingData为false
java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is nullat com.emily.infrastructure.test.controller.LogbackController.debug(LogbackController.java:33)at com.emily.infrastructure.test.controller.LogbackController$$FastClassBySpringCGLIB$$2de19373.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:70)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)at com.emily.infrastructure.autoconfigure.request.interceptor.DefaultRequestMethodInterceptor.invoke(DefaultRequestMethodInterceptor.java:64)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)at com.emily.infrastructure.test.controller.LogbackController$$EnhancerBySpringCGLIB$$3879bcba.debug(<generated>)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.base/java.lang.reflect.Method.invoke(Method.java:568)at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)at javax.servlet.http.HttpServlet.service(HttpServlet.java:529)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:114)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)at com.emily.infrastructure.core.servlet.filter.RequestChannelFilter.doFilter(RequestChannelFilter.java:26)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.base/java.lang.Thread.run(Thread.java:833)

GitHub源码:https://github.com/mingyang66/spring-parent

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/5938.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Hadoop——Hadoop单机搭建问题汇总

1、org.apache.hadoop.security.AccessControlException: Permission denied: userroot... 解决方法&#xff1a;关闭Hadoop,在hdfs-site.xml文件中添加&#xff1a; <property><name>dfs.permissions</name><value>false</value> </proper…

【Unity2D】设置一物体默认在其他物体之上不被遮挡

比如我想让机器人显示在箱子的前面。 点击箱子&#xff0c;将其层级设置在机器人的后面。 即修改箱子的Order in Layer 在机器人之后 物体默认的Order in Layer 都是0 &#xff0c;将箱子的Order in Layer修改为-1即可 这样将确保先绘制机器人&#xff0c;然后绘制箱子。这样…

C#鼠标拖拽,移动图片实例

最近工作需要做一个鼠标可以拖拽移动图片的功能。 写了几个基本功能&#xff0c;勉强能用。这里记录一下。欢迎大神补充。 这个就是完成的功能。 下边的绿色是一个pictureBox&#xff0c;白色框也是一个pictureBox&#xff0c;他们二者是子父级关系。 绿色是父级&#xff0c…

【图论】最短路算法

1、Dijkstra算法 不能处理边权为负的情况&#xff0c;复杂度O(nlogn) 步骤与基本思路 &#xff08;1&#xff09;初始化距离数组dist[N]&#xff0c;将其所有值赋为0x3f&#xff0c;并将起点1的dist初始化为0&#xff0c;存入优先队列heap中 &#xff08;2&#xff09;从所…

shell编程之正则表达式

正则表达式&#xff1a;由一类特殊的字符以及文本字符所编写的一种模式&#xff0c;处理文本当中的内容 其中的一些字符不表示字符的字面含义&#xff0c;表示控制或者通配的功能 通配符&#xff1a;匹配文件名和目录名&#xff0c;不能匹配文件的内容 正则表达式&#xff1a;可…

STM32 BOOTLOADER配置以及APP跳转实现(裸机)

配置实现环境:KEIL 一、STM32BootLoader配置 Bootloader: Bootloader是硬件启动的引导程序,是运行操作系统的前提。在操作系统内核或用户应用程序运行之前运行的一段小代码。对硬件进行相应的初始化和设定,最终为操作系统准备好环境。 APP:APP就是我们的应用程序,经过硬件…

NAS私有云存储 - 搭建Nextcloud私有云盘并公网远程访问

文章目录 摘要视频教程1. 环境搭建2. 测试局域网访问3. 内网穿透3.1 ubuntu本地安装cpolar3.2 创建隧道3.3 测试公网访问 4 配置固定http公网地址4.1 保留一个二级子域名4.1 配置固定二级子域名4.3 测试访问公网固定二级子域名 摘要 Nextcloud,它是ownCloud的一个分支,是一个文…

Centos Certbot 使用

安装 可选配置&#xff1a;启动EPEL存储库 非必要项 yum install -y epel-release yum clean all yum makecache #启用可选通道 可以不配置 yum -y install yum-utils yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional必要配置…

【《Spring Boot微服务实战(第2版)》——一本关于如何在Spring Boot中构建微服务的全面指南】

使用Spring Boot框架构建基于Java的微服务架构&#xff0c;将应用程序从小型单体架构蜕变为由多个服务组成的事件驱动架构。这个最新版本围绕服务发现、负载均衡、路由、集中式日志、按环境配置和容器化等知识点&#xff0c;循序渐进地讲述微服务架构、测试驱动的开发和分布式系…

Mysql 主从复制、读写分离

目录 一、前言&#xff1a; 二、主从复制原理 2.1 MySQL的复制类型 2.2 MySQL主从复制的工作过程; 2.2.1 MySQL主从复制延迟 2.3 MySQL 有几种同步方式&#xff1a; 三种 2.3.1、异步复制&#xff08;Async Replication&#xff09; 2.3.2、同步复制&#xff08;Sync Re…

centos逻辑分区磁盘扩展

最近碰到服务器磁盘空间不足&#xff0c;需要扩展逻辑分区的需求&#xff0c;特地做下小笔记&#xff0c;方便后续自己回忆。下图是磁盘的相关概念示意图&#xff1a; 1、查看磁盘空间 [rootlocalhost ~]# df -h #查看磁盘空间&#xff0c;根分区的大小是18G&#xff0c;已经用…

力扣 -- 918. 环形子数组的最大和

一、题目&#xff1a; 题目链接&#xff1a;918. 环形子数组的最大和 - 力扣&#xff08;LeetCode&#xff09; 二、解题步骤&#xff1a; 下面是用动态规划的思想解决这道题的过程&#xff0c;相信各位小伙伴都能看懂并且掌握这道经典的动规题目滴。 三、参考代码&#xff1…

PCL点云处理之最小二乘直线拟合(2D| 方法2)(❤亲测可用❤)(二百零一)

PCL点云处理之最小二乘直线拟合(2D| 方法2)(❤亲测可用❤)(二百零一) 一、算法简介二、算法实现1.代码2.结果一、算法简介 在二百章中,我们介绍了一种最小二乘拟合直线点云(2D)的方法,可以获取直线方程系数k,b,这里介绍另一种拟合直线点云的方法,更为简单方便,结果…

AutoSAR系列讲解(实践篇)7.5-OS原理进阶

在AutoSAR系列讲解(入门篇)4.8-BSW的OS功能_autosar os_ManGo CHEN的博客-CSDN博客的时候,就稍微讲了一下OS,当时还挖了坑,说详细的内容放在实践篇中来讲,那么博主准备在这里将这个坑填上。如果对OS有点生疏了, 可以回头再看看AutoSAR系列讲解(入门篇)4.8-BSW的OS功能…

MGRE之OSPF实验

目录 题目&#xff1a; 步骤二&#xff1a;拓扑设计与地址规划​编辑 步骤三&#xff1a;IP地址配置 步骤四&#xff1a;缺省路由配置 步骤五&#xff1a;NAT的配置 步骤六&#xff1a;MGRE配置 中心站点R1配置 分支站点配置 中心站点R5 R1配置 分支站点配置 检测&…

Linux 搜索文件中find和grep命令的区别

在使用linux时&#xff0c;经常需要进行文件查找。其中查找的命令主要有find和grep。两个命令是有区的。 (1)find命令是根据文件的属性进行查找&#xff0c;如文件名&#xff0c;文件大小&#xff0c;所有者&#xff0c;所属组&#xff0c;是否为空&#xff0c;访问时间&#x…

S32K1xx SDK(版本:S32_SDK_S32K1xx_RTM_4.0.3 )详细介绍

前言 在学习一款MCU之前&#xff0c;一般我的习惯是先下载官方提供的SDK包进行学习。然后学习了解SDK提供的资源、框架、以及各目录结构文件作用等&#xff0c;下面边学边做笔记记录。 S32K1系列SDK我们可以到下面的NXP官网去获取&#xff1a; https://www.nxp.com.cn/design…

微服务如何治理

微服务远程调用可能有如下问题&#xff1a; 注册中心宕机&#xff1b; 服务提供者B有节点宕机&#xff1b; 服务消费者A和注册中心之间的网络不通&#xff1b; 服务提供者B和注册中心之间的网络不通&#xff1b; 服务消费者A和服务提供者B之间的网络不通&#xff1b; 服务提供者…

一、二维前缀和算法

文章目录 前缀和模板724. 寻找数组的中心下标238. 除自身以外数组的乘积560. 和为 K 的子数组974. 和可被 K 整除的子数组525. 连续数组1314. 矩阵区域和 前缀和模板 一维前缀和&#xff1a; import java.util.*;public class Main {public static void main(String[] args) …

“深入探索Spring Boot:从入门到实战“

标题&#xff1a;深入探索Spring Boot&#xff1a;从入门到实战 摘要&#xff1a; Spring Boot是一个快速构建基于Spring框架的应用程序的工具&#xff0c;它提供了自动化配置和约定优于配置的方式&#xff0c;让开发者可以更快地搭建和部署应用程序。本文将带您深入探索Sprin…