国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Log4j2的Configuration詳解

這篇具有很好參考價值的文章主要介紹了Log4j2的Configuration詳解。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

官方配置文檔:
https://logging.apache.org/log4j/2.x/manual/filters.html

根節(jié)點<Configuration>

<!--設(shè)置log4j2自身內(nèi)部的信息輸出級別為info-->
<!--Log4j每隔10秒自動檢測修改配置文件和重新配置本身,不需要重啟服務(wù)-->
<Configuration status="info" monitorInterval="10">
</Configuration>

參數(shù)介紹: 文章來源地址http://www.zghlxwxcb.cn/news/detail-405823.html

Attribute Name Description
name The name of the configuration.
monitorInterval Log4j has the ability to automatically detect changes to the configuration file and reconfigure itself。
即動態(tài)加載,單位是秒??勺远x配置,最小間隔為5秒
status 記錄log4j本身的日志級別
The level of internal Log4j events that should be logged to the console.
Valid values for this attribute are “off”, “trace”, “debug”, “info”, “warn”, “error”, “fatal”, and “all”.
如果需要對log4j進(jìn)行故障排除,可設(shè)置status=“trace”
設(shè)置系統(tǒng)屬性Log4j2.debug也會將內(nèi)部Log4j2日志記錄打印到控制臺
advertiser (Optional) The Advertiser plugin name which will be used to advertise individual FileAppender or SocketAppender configurations. The only Advertiser plugin provided is 'multicastdns".
dest Either “err” for stderr, “out” for stdout, a file path, or a URL.
packages Use of the packages attribute is deprecated and will be removed in Log4j 3.0. Plugins should be processed with the Log4j annotation processor. A comma separated list of package names to search for plugins. Plugins are only loaded once per classloader so changing this value may not have any effect upon reconfiguration.
schema Identifies the location for the classloader to located the XML Schema to use to validate the configuration. Only valid when strict is set to true. If not set no schema validation will take place.
shutdownHook Specifies whether or not Log4j should automatically shutdown when the JVM shuts down. The shutdown hook is enabled by default but may be disabled by setting this attribute to “disable”
shutdownTimeout Specifies how many milliseconds appenders and background tasks will get to shutdown when the JVM shuts down. Default is zero which mean that each appender uses its default timeout, and don’t wait for background tasks. Not all appenders will honor this, it is a hint and not an absolute guarantee that the shutdown procedure will not take longer. Setting this too low increase the risk of losing outstanding log events not yet written to the final destination. See LoggerContext.stop(long, java.util.concurrent.TimeUnit). (Not used if shutdownHook is set to “disable”.)
strict Enables the use of the strict XML format. Not supported in JSON configurations.
verbose Enables diagnostic information while loading plugins.

到了這里,關(guān)于Log4j2的Configuration詳解的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 日志框架梳理(Log4j,Reload4j,JUL,JCL,SLF4J,Logback,Log4j2)

    文中代碼示例獲?。宏P(guān)注【 Qin的學(xué)習(xí)營地 】,回復(fù)【 日志框架梳理 】 在了解日志框架時總會列出一系列框架:Log4j,Reload4j,JUL,JCL,SLF4J,Logback,Log4j2,這么多框架讓人感到混亂,該怎么選取、該怎么用。接下來,讓我們逐步理清這些框架及之間的關(guān)系。 首先來了解日志

    2024年02月05日
    瀏覽(62)
  • Log4j反序列化命令執(zhí)行漏洞(CVE-2017-5645)&Apache Log4j2 lookup JNDI 注入漏洞(CVE-2021-44228)

    Log4j反序列化命令執(zhí)行漏洞(CVE-2017-5645)&Apache Log4j2 lookup JNDI 注入漏洞(CVE-2021-44228)

    Apache Log4j是一個用于Java的日志記錄庫,其支持啟動遠(yuǎn)程日志服務(wù)器。Apache Log4j 2.8.2之前的2.x版本中存在安全漏洞。攻擊者可利用該漏洞執(zhí)行任意代碼 環(huán)境:vulhub 工具下載地址: ysoserial 利用工具生成payload: 1.創(chuàng)建文件 進(jìn)入容器內(nèi)部,查看文件創(chuàng)建成功 2.查看反彈的shell 有點

    2024年02月11日
    瀏覽(37)
  • 深入理解 SpringBoot 日志框架:從入門到高級應(yīng)用——(五)Log4j2配置文件詳解

    Log4j2 官方文檔:https://logging.apache.org/log4j/2.x/manual/index.html Log4j2 是一個Java日志框架,用于記錄應(yīng)用程序在運行時的信息。它是 Log4j 的升級版本,提供了更快的處理速度,更快的日志記錄和更豐富的日志記錄功能,并支持異步日志記錄,減少了對應(yīng)用程序性能的影響。它可以

    2024年02月05日
    瀏覽(26)
  • Spring Boot 配置 log4j2

    Spring Boot 配置 log4j2

    本教程中,我們將學(xué)習(xí)如何在 Spring Boot 中整合使用 Log4j2 日志框架。 Spring Boot 中默認(rèn)使用 Logback 作為日志框架,接下來我們將學(xué)習(xí)如何在 Spring Boot 中集成與配置 Log4j2。在配置之前,我們需要知道的是 Log4j2 是 Log4j 的升級版,它在 Log4j 的基礎(chǔ)上做了諸多改進(jìn): 1.異步日志;

    2024年02月08日
    瀏覽(22)
  • Log4j2 配置日志記錄發(fā)送到 kafka 中

    前言 log4j2 在 2.11.0 之后的版本,已經(jīng)內(nèi)置了 KafkaAppender 支持可以將打印的日志直接發(fā)送到 kafka 中,在這之前如果想要集中收集應(yīng)用的日志,就需要自定義一個 Layout 來實現(xiàn),相對來說還是比較麻煩的。 官網(wǎng)文檔:Log4j – Log4j 2 Appenders 依賴 配置 注意這里有個 syncSend 控制著是

    2024年02月10日
    瀏覽(19)
  • Springboot整合與使用log4j2日志框架【詳解版】

    Springboot整合與使用log4j2日志框架【詳解版】

    Spring Boot默認(rèn)使用LogBack,但是我們沒有看到顯示依賴的jar包,其實是因為所在的jar包spring-boot-starter-logging都是作為spring-boot-starter-web或者spring-boot-starter依賴的一部分。 如果這里要使用Log4j2,需要從spring-boot-starter-web中去掉spring-boot-starter-logging依賴,同時顯示聲明使用Log4j2的依

    2024年02月11日
    瀏覽(29)
  • java 項目配置slf4j - log4j2

    2024年02月13日
    瀏覽(24)
  • Java日志系統(tǒng)log4j2的使用配置和異步日志使用

    Java日志系統(tǒng)log4j2的使用配置和異步日志使用

    Apache Log4j2是Log4j的升級版,參考了logback一些優(yōu)秀的設(shè)計,并且修復(fù)了logback的一些問題,而且性能上也有了重大提升,主要有: log4j2對Appender提供了一些異常處理機(jī)制 參考了logback的設(shè)計,提供自動刷新參數(shù)配置,可以自動重載配置而不用重啟應(yīng)用 log4j2利用緩沖區(qū)和重用對象

    2024年02月02日
    瀏覽(52)
  • [CVE-2021-44228]:log4j2漏洞學(xué)習(xí)與復(fù)現(xiàn)流程詳解(vulhub環(huán)境)

    [CVE-2021-44228]:log4j2漏洞學(xué)習(xí)與復(fù)現(xiàn)流程詳解(vulhub環(huán)境)

    剛搭好vulhub,迫不及待的來復(fù)現(xiàn)一下2021-2022最潮最in的漏洞log4j2,因為算是熱點了面試什么的的感覺都蠻容易被問到的,這里就來整理一下這個漏洞相關(guān)信息和漏洞復(fù)現(xiàn)的流程。 影響版本:log4j 2.x = 2.14.1 漏洞簡介 首先肯定得簡單了解一下log4j2到底是什么東西,log4j2是Apache的

    2024年02月08日
    瀏覽(27)
  • log4j2漏洞分析

    log4j2漏洞分析

    和前面的JNDI注入時用的代碼差不多 如果要引入log4j2的jar包可以這么配置Maven的pom.xml 還要創(chuàng)建個配置文件 log4j2這個漏洞當(dāng)時爆出來的時候堪稱是核彈級別的,危害非常大,利用還非常簡單,既然如此,那我們肯定要分析一下漏洞相關(guān)的原理來學(xué)習(xí)一下 這個漏洞是個JNDI注入漏

    2024年02月09日
    瀏覽(32)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包