Logging using Log4j.xml in Glassfish

感情迁移 提交于 2019-12-22 00:12:17

问题


I was using WAS as my application server for deploying ear project.Presently changed to Glassfish. I am using log4j.xml file for logging. Logging is not working in Glassfish.

Is there any dependency in using log4j.xml with glassfish.

Any suggestions/pointers is appreciated


回答1:


If your log4j library is included within your EAR file, then check your app server's JVM properties to ensure the log4j.configuration property is set:

  1. Login to the Glassfish Admin Console (http://[hostname]:4848/)
  2. For your server, navigate to Configuration > JVM Settings > JVM Options
  3. If an entry for -Dlog4j.configuration exists, verify that it contains the location of your log4j.xml file
  4. If an entry do not exist for -Dlog4j.configuration, create one. It must follow the following template: -Dlog4j.configuration=file:///path/to/your/log4j.xml


来源:https://stackoverflow.com/questions/17673670/logging-using-log4j-xml-in-glassfish

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