ITPub博客

首页 > IT基础架构 > 网络安全 > Application Use Log4j

Application Use Log4j

原创 网络安全 作者:jdskyy 时间:2007-01-26 09:31:50 0 删除 编辑
在应用程序中使用log4j 输出日志

[@more@]

在应用程序中使用log4j 输出日志

public static void main(String[] args) {
Properties props = new Properties();
props.setProperty("log4j.rootLogger", "INFO, stdout");
props.setProperty("log4j.appender.stdout", "org.apache.log4j.ConsoleAppender");
props.setProperty("log4j.appender.stdout.layout", "org.apache.log4j.PatternLayout");
props.setProperty("log4j.appender.stdout.layout.ConversionPattern", "%-5p (%20F:%-3L) - %mn");
PropertyConfigurator.configure(props);

ScraperConfiguration config = new ScraperConfiguration("examples/yoo.xml");
Scraper scraper = new Scraper(config, "c:/temp/scrapertest/");

scraper.setDebug(true);

scraper.execute();
}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/557469/viewspace-893755/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: UnZip
请登录后发表评论 登录
全部评论
  • 博文量
    9
  • 访问量
    31898