log4j使用例子
来源:互联网 发布:pdf.js跨域 java 编辑:程序博客网 时间:2024/05/01 13:20
package log4jtest;
import org.apache.log4j.Logger;
import org.apache.log4j.Level;
import org.apache.log4j.BasicConfigurator;
public class log4jtest1 {
public log4jtest1() {
}
public static void main(String[] args) {
log4jtest1 log4jtest1 = new log4jtest1();
//1.create a logger
Logger loggerIns = Logger.getLogger(log4jtest1.class);
//2.use the default confirguation
BasicConfigurator.configure();
//3.set the logger level to info
loggerIns.setLevel(Level.INFO);
//4.This request will be disabled since Level.DEBUG < Level.INFO.
loggerIns.debug("this is a debug");
//5.these requests will be eabled
loggerIns.info("this is a info");
loggerIns.warn("this is a warn");
loggerIns.debug("this is a error");
loggerIns.fatal("this is a fatal");
return ;
}
}
import org.apache.log4j.Logger;
import org.apache.log4j.Level;
import org.apache.log4j.BasicConfigurator;
public class log4jtest1 {
public log4jtest1() {
}
public static void main(String[] args) {
log4jtest1 log4jtest1 = new log4jtest1();
//1.create a logger
Logger loggerIns = Logger.getLogger(log4jtest1.class);
//2.use the default confirguation
BasicConfigurator.configure();
//3.set the logger level to info
loggerIns.setLevel(Level.INFO);
//4.This request will be disabled since Level.DEBUG < Level.INFO.
loggerIns.debug("this is a debug");
//5.these requests will be eabled
loggerIns.info("this is a info");
loggerIns.warn("this is a warn");
loggerIns.debug("this is a error");
loggerIns.fatal("this is a fatal");
return ;
}
}
- 使用Log4j例子
- log4j使用例子
- Log4j使用小例子
- log4j 例子
- Log4j例子
- log4j的简单的例子~以及使用log4j和不使用log4j的对比
- 使用jdbc来保存log4j日志信息的一个例子
- Log4J学习【二十七】常用Appender使用例子
- log4j.properties例子
- log4j.properties例子
- LOG4J配置例子
- log4j 应用例子
- log4j配置文件的例子
- Log4j XML配置例子
- log4j的layout 例子
- Log4j配置例子
- log4j配置文件的例子
- Log4j简介,例子
- HOOK专题
- Java专业术语标准化规范
- overflow的另类用法
- struts2入门
- 中国的银行英文缩写趣解
- log4j使用例子
- 强大人肉搜索:在巴黎殴打金晶的ZD分子详细资料曝光
- 用串口线连接 终端来安装aix
- 用ASP.NET将网页错误信息写入系统日志
- 在内容里取图片的src里的图片名,代码如下:vbscript
- Linear、Discrete、Spline的区别
- fckeditor(2.6) 二次开发,添加新的选项卡到图片属性对话框
- Ubuntu下面apache2安装
- asp.net 常用代码