WAS Logging - Java Util Logging and Log4j

▼魔方 西西 提交于 2019-12-06 16:05:09

Hello We just when through the same exercise: JUL vs Log4j when using WAS. We decided to go for Log4j.

1) Yes if your App use JUL, you should be able to change the Level from that console.

2) I am not sure.

3) No you cannot change Log4j from WAS Console. In our case we created a simple MBean so we could control the Lo4j log Level of each WebApp (via wsadmin). There is also a nice and simple JSP from BEA that you can include in you WebApp to have a UI to see each category.

If you decide to use JUL (over log4j), make sure to understand the following implication:

  • JUL doest not have many out-of the box Handlers.

  • JUL is at the JVM Level, All you App will share it. If you develop custom JUL Hanlder, all WebApp will share the same Instance.

  • Because JUL Handler are common, it is hard to split Each App in a separate logfile(one per WebApp).

  • When using third party Lib (Spring, Ibatis etc) and if you use JUL, when you will change the Log Level to DEBUG on Spring, it will be changed for ALL you WebApp. If you need more fine grain (changing level on Spring on a specific WebApp) then it is better to embed Log4j in each WebApp.

Hope this will help you

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!