1

我已经按照所有步骤

http://docs.oracle.com/cd/E35521_01/doc.111230/e24475/debugging.htm

我的模拟器与服务器连接。我已经尝试了所有显示错误的代码。但不打印日志。我使用以下代码来显示日志。

System.out.print("test new");

Trace.log(Utility.ApplicationLogger, Level.SEVERE, test.class, "activate",
          "!!!!!!!!!!Feature 1 Activate!!!!!!!!!!");
        adf.mf.log.Application.logp(adf.mf.log.level.WARNING,"myClass","myMethod","My Message");

Utility.ApplicationLogger.logp(Level.WARNING, 
                                  test.class.getName(),
                                  "onTestMessage",
                                  "embedded warning message 1");

   Logger.getLogger(Utility.APP_LOGNAME).logp(Level.WARNING,
                                                 this.getClass().getName(),
                                                 "onTestMessage",
                                                 "embedded warning message 2");

   Logger.getLogger("oracle.adfmf.application").logp(Level.WARNING,
                                                this.getClass().getName(),
                                                "onTestMessage",
                                                "embedded warning message 3");

并且还使用 javascript 来显示日志。仍然不打印日志。

AdfmfContainerUtilities.invokeContainerJavaScriptFunction("JavaScript", "doAlert", new Object[] {"arg1"});

我的java脚本是:

(function () {
    doAlert = function (str) 
    {
    var s = '';
    s = s + str;
        alert('hello  ' + s);
    };
})();

我的 cvm.property 文件是:

# Java debugging settings
java.debug.enabled=true

# Specifies the integer value of the port to use during debugging
java.debug.port=4000

# JavaScript debugging settings
javascript.debug.enabled=true

# Settings for the default heap size
#  refer to http://docs.oracle.com/javame/config/cdc/cdc-opt-impl/ojmeec/1.0/runtime/html/cvm.htm
java.commandline.argument=-Xms50M
java.commandline.argument=-Xmn25M
java.commandline.argument=-Xmx125M

# Specifies the feature that will trigger the activation of the JavaScript debugging
javascript.debug.feature=feature1:

我的 logging.properties 文件是:

# default all loggers to use the ConsoleHandler
.handlers=com.sun.util.logging.ConsoleHandler

# default all loggers to use the SimpleFormatter
.formatter=com.sun.util.logging.SimpleFormatter

# default ConsoleHandler logging level to SEVERE
oracle.adfmf.util.logging.ConsoleHandler.level=SEVERE

oracle.adfmf.util.logging.ConsoleHandler.formatter=oracle.adfmf.util.logging.PatternFormatter
#oracle.adfmf.util.logging.ConsoleHandler.level=FINEST
oracle.adfmf.util.logging.PatternFormatter.pattern=[%LEVEL% - %LOGGER% - %CLASS% - %METHOD%] %MESSAGE%

#configure the framework logger to only use the adfmf ConsoleHandler
oracle.adfmf.framework.useParentHandlers=false
oracle.adfmf.framework.handlers=oracle.adfmf.util.logging.ConsoleHandler
oracle.adfmf.framework.level=SEVERE

#configure the application logger to only use the adfmf ConsoleHandler
oracle.adfmf.application.useParentHandlers=false
oracle.adfmf.application.handlers=oracle.adfmf.util.logging.ConsoleHandler
oracle.adfmf.application.level=SEVERE
4

0 回答 0