且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Glassfish中的Log4j.xml进行日志记录

更新时间:2023-11-22 16:22:04

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