使用Glassfish中的Log4j.xml进行日志记录 [英] Logging using Log4j.xml in Glassfish

查看:96
本文介绍了使用Glassfish中的Log4j.xml进行日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 WAS 作为我的应用程序服务器来部署ear project.Presently更改为 Glassfish 。我正在使用log4j.xml文件进行日志记录。日志记录在GlassFish中不起作用。



是否在使用log4j.xml和glassfish时存在任何依赖关系。



任何如果您的log4j库包含在您的EAR文件中,那么请检查您的应用服务器的JVM属性,以确保您的应用服务器的JVM属性log4j.configuration属性设置为:


  1. 登录到Glassfish管理控制台(http:// [hostname]:4848 / li>
  2. 对于您的服务器,导航至配置> JVM设置> JVM选项

  3. 如果存在-Dlog4j.configuration条目,请验证它是否包含您的log4j.xml文件

  4. 如果条目不存在,则为-Dlog4j.configuration创建一个。它必须遵循以下模板:-Dlog4j.configuration = file:///path/to/your/log4j.xml


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

解决方案

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

这篇关于使用Glassfish中的Log4j.xml进行日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆