惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
Y
Y Combinator Blog
Recorded Future
Recorded Future
博客园 - Franky
I
InfoQ
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Cloudbric
Cloudbric
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Check Point Blog
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
U
Unit 42
N
Netflix TechBlog - Medium
The Cloudflare Blog
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
T
Troy Hunt's Blog
Engineering at Meta
Engineering at Meta
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
B
Blog
S
Securelist
H
Hacker News: Front Page
Google Online Security Blog
Google Online Security Blog
G
Google Developers Blog

博客园 - From Ocean

how to solve error when start Hyper-V quick create app error (转载)Tips on using log4net RollingFileAppender by Rohit Gupta (Asp.Net)转载-用Powershell 建立IIS web site (DP)降低代码重构的风险(转载) (Life)牛人的学习方法(转译文) (WPF)WPF事件要点-WPF宝典笔记 (WPF)路由事件要点-WPF宝典笔记 (WPF)依赖属性要点-WPF宝典笔记 (Ruby)Ubuntu12.04安装Rails环境 (Ruby)方法的一些有趣的地方--待补充 (Ruby)Ruby中区块用的一些潜藏关键字 (Ruby)类变量,实例变量,类常量,如何访问变量 (WPF)WPF要点之命令-深入浅出WPF笔记 (WPF)WPF要点之事件-深入浅出WPF笔记 (Algorithm)计算机科学中最重要的32个算法_转载infoq上的文章 (转载)postgresql无法远程登录(设置远程登陆的三点注意事项) (.Net,DevExpress)关于devexpress部分aspx控件需要注意的细节_持续补充ing (.Net,DevExpress)devexpress源码编译需要注意的地方 (Silverlight,WCF,Socket,Cocurrency)一周浏览碰到不错的文章
log4j 2使用properties文件进行配置
From Ocean · 2017-09-06 · via 博客园 - From Ocean

网上不少文章给的都是用xml进行配置,也会提到无法使用properties文件对log4j进行配置,但那应该只是在他们写文章的时候才是如此,最新的2.8.2版本经过我试验后是可以做到的当然该文件最好放在特定的目录中才行,官方文档也提到了

1.Log4j will inspect the "log4j.configurationFile" system property and, if set, will attempt to load the configuration using the ConfigurationFactory that matches the file extension.
2.If no system property is set the YAML ConfigurationFactory will look for log4j2-test.yaml or log4j2-test.yml in the classpath.
3.If no such file is found the JSON ConfigurationFactory will look for log4j2-test.json or log4j2-test.jsn in the classpath.
4.If no such file is found the XML ConfigurationFactory will look for log4j2-test.xml in the classpath.
5.If a test file cannot be located the YAML ConfigurationFactory will look for log4j2.yaml or log4j2.yml on the classpath.
6.If a YAML file cannot be located the JSON ConfigurationFactory will look for log4j2.json or log4j2.jsn on the classpath.
7.If a JSON file cannot be located the XML ConfigurationFactory will try to locate log4j2.xml on the classpath.
8.If no configuration file could be located the DefaultConfiguration will be used. This will cause logging output to go to the console.
name = PropertiesConfig
property.filename = target/logs

#appenders = console, file
#配置值是appender的类型,并不是具体appender实例的name
appenders = rolling

appender.rolling.type = RollingFile
appender.rolling.name = RollingLogFile
appender.rolling.fileName=${filename}/automationlogs.log
appender.rolling.filePattern = ${filename}/automationlogs-%d{MM-dd-yy-HH-mm-ss}-%i.log
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
appender.rolling.policies.type = Policies
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=100MB
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.max = 5
 
rootLogger.level = trace
rootLogger.appenderRef.rolling.ref = rolling
rootLogger.appenderRef.rolling.ref = RollingLogFile