How to use Log4j in WSAD5.0

xinxin2 2003-06-19 05:16:44
Hi all,

I want to use Log4j in my project, and I am using WSAD5.0. I have downloaded log4j.jar from log4j website, and I copied log4j.jar to my project root, and also I put the log4j.properties in the classpath. The problem is when I use it, it did generate the log file, but nothing in it, so I am wandering how to write somthing into the log file? Thank you all a lot!

...全文
29 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
leonzhao 2003-06-21
  • 打赏
  • 举报
回复
Please describe you detail steps to create project, import jar and so on.
xinxin2 2003-06-20
  • 打赏
  • 举报
回复
Thank you guys very much!

I still cannot make it work. I deleted the log file, when I ran the project this time, the log file was not generated at all, do not know why. I wander if the common-loggins.jar which is the log jar WSAD itself, so is that the reason it does not load my .properties file properly? Anyone had this problem before?

Thanks
liusoft 2003-06-19
  • 打赏
  • 举报
回复
确定你的log4j.properties配置是否正确,
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n
leonzhao 2003-06-19
  • 打赏
  • 举报
回复
I think you should look at log4j's how to use first.

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧