差異處
這裏顯示兩個版本的差異處。
java:log4j2:indicateconfigurationfile [2022/04/10 09:18] tony [How to?] |
java:log4j2:indicateconfigurationfile [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | {{tag>log4j2}} | ||
- | ====== Indicate Log4j2 Configuration File ====== | ||
- | ===== Problem ===== | ||
- | 在使用IDE開發時,類似log4j1通常只要將設定檔放在classpath中,並且檔名為log4j2-test.properties或log4j2.properties,在編譯後就可以享用log功能。然而,在軟體發布並安裝到使用者系統時,設定檔並不完完全全會依照這個規則放置或命名,你很有可能會有不同的應用程式使用不同設定檔的需求。本篇文章主要分享要解決這個問題的設定方法。 | ||
- | ===== How to? ===== | ||
- | ==== 指定設定檔 ==== | ||
- | |||
- | ==== 指定log產生位置 ==== | ||
- | |||
- | |||
- | ==== 設定檔搜尋規則 ==== | ||
- | |||
- | |||
- | ===== Reference ===== | ||
- | * [[https://logging.apache.org/log4j/2.x/manual/configuration.html#Automatic%20Configuratio|官方網站檔案設定介紹]] | ||
- | ===== ===== | ||
- | ---- | ||
- | \\ | ||
- | ~~DISQUS~~ |