Config log4j in standalone app
来源:互联网 发布:软件测试转正心得体会 编辑:程序博客网 时间:2024/04/30 12:05
1. First make sure you've added the log4j.jar
2. config log4j.xml and log4j.properties
Show an example:
log4j.xml
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"><log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'><appender name="CA" class="org.apache.log4j.ConsoleAppender"><layout class="org.apache.log4j.PatternLayout"><param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - %m%n" /></layout></appender><root><level value="debug" /><appender-ref ref="CA" /></root></log4j:configuration>
log4j.properties
log4j.rootLogger=DEBUG, CAlog4j.appender.CA=org.apache.log4j.ConsoleAppenderlog4j.appender.CA.layout=org.apache.log4j.PatternLayoutlog4j.appender.CA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Done!
http://www.dzone.com/tutorials/java/log4j/log4j-xml-configuration.html
- Config log4j in standalone app
- Config windows Service Name in App.config
- Spark系列(2)—A Standalone App in Scala
- WCF Server Configuration in Web.config or App.config
- How to config spring objects in app.config
- Config log4j
- log4j config
- log4j config
- Working with Configuration Files (app.config) in C++/CLI
- Working with Configuration Files (app.config) in C++/CLI
- ConnectionStringManager (build, edit connectionString in app.config file)
- In Debug , which app.config file is using ?
- How to use App.Config in WPF applications
- applicationId is set to 'com.super.app' in default config
- app.config
- app.config
- app.config
- app.config
- Spring config different datasource based on different environment(dev, test, prod) Two ways now
- 利用Camera实现手电筒功能
- 关于getchar()函数_1
- 直接删除数据文件后无法进入系统的解决方案
- 关于随机数_5
- Config log4j in standalone app
- 353. Penny wise, pound foolish. 贪小便宜吃大亏
- java里面的Annotation的使用
- HBase源代码调试(1)
- Mac 系统常用快捷键
- 第五篇 对话框控件的使用
- Python3 批量转换文件编码 Encoding
- JAVA中的两种典型排序,选择和冒泡
- 谨以这篇文章作为我编程道路的目标,规范和准则!