在oc4j 10.1.3中使用log4j [英] Using log4j in oc4j 10.1.3

查看:135
本文介绍了在oc4j 10.1.3中使用log4j的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OC4J 10.1.3上运行了一个Web应用程序。我正在尝试使用log4j进行一些日志记录。消息按预期显示在我的IDE控制台中,但OC4J中的application.log没有任何内容。有人知道我需要做些什么才能使这个工作吗?

I have a web application running on OC4J 10.1.3. I am trying to do some logging using log4j. The messages show up in my IDE console as expected, but nothing is going into the application.log in OC4J. Anybody know what I need to do to get this working?

这是我的log4j.properties:

Here's my log4j.properties:

log4j.rootCategory=DEBUG, CON1

# CON1 is set to be ConsoleAppender sending its output to System.out
log4j.appender.CON1=org.apache.log4j.ConsoleAppender
log4j.appender.CON1.layout=org.apache.log4j.PatternLayout
log4j.appender.CON1.layout.ConversionPattern=%p: [%l] - %m%n

log4j.logger.org.apache.ojb.broker.accesslayer=DEBUG

在我的java类中,我这样做:

And in my java classes I'm doing this:

Logger logger = Logger.getLogger(getClass().getName());
logger.debug("Test message.");


推荐答案

配置OC4J以将控制台输出记录到文件中。

如果您使用完整的IAS,请将此添加到opmn.xml

Configure OC4J to log the console output to a file.
If you are using the full IAS add this to the opmn.xml

<data id="oc4j-options" value="-verbosity 10 -err err.log -out out.log"/>

如果您使用的是独立式OC4j:

If you are using the stanalone OC4j:

  java -jar oc4j.jar -err err.log -out out.log

这篇关于在oc4j 10.1.3中使用log4j的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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