2017-09-29 81 views
0

我有一个webstart应用程序,可以与Log4j 1一起正常工作。 现在我已经将它迁移到Log4J2。在Eclipse中一切正常。但是,如果我启动它Webstart的应用,我总是得到消息:Log4j2 with webstart

"ERROR StatusLogger No log4j2 configuration file found. 
 
Using default configuration: 
 
logging only errors to the console. 
 
Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' 
 
to TRACE to show Log4j2 internal initialization logging. 
 
"

我做错了吗?

我的JNLP看起来像:

<?xml version="1.0" encoding="UTF-8"?> 
<jnlp spec="1.0+" codebase="http://localhost:8085/MyApp/" href="client.jnlp"> 
<information> 
     <title>My new App</title> 
<vendor>MyCompany</vendor> 
     <icon kind="splash" href="img/splash.jpg"/> 
     <icon href="img/logo.png"/> 
    </information> 
    <security> 
     <all-permissions/> 
    </security> 
    <resources> 
     <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/> 
     <extension name="dependencies" href="dependencies.jnlp" /> 
     <extension name="properties" href="properties.jnlp" /> 
    </resources> 

    <application-desc main-class="com.client.MyApp"> 
     <argument>-webstart</argument> 
    </application-desc> 

</jnlp> 

而且log4j.configuration被放置在properties.jnlp:

<jnlp spec="1.0+" href="properties.jnlp"> 
    <information> 
    <title>My new App</title> 
    <vendor>MyCompany</vendor> 
    </information> 
    <security> 
    <all-permissions/> 
    </security> 
    <resources> 
     <!-- Properties --> 
     <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/> 
     <property name="client.ini" value="http://localhost:8085/MyApp/cfg/client.ini"/> 
     <property name="log4j.configuration" value="http://localhost:8085/MyApp/cfg/log4j2.xml"/> 
    </resources> 
    <component-desc/> 
</jnlp> 

回答

0

我发现soulution。

在log4j2中,propertyName更改为log4j.configurationFile

这是我唯一需要改变的地方。