如何降低Java Ant任务中的日志级别

时间:2020-03-03 14:42:13

标签: java maven logging ant pom.xml

我有以下配置

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.8</version>
    <executions>
        <execution>
            <id>generate-code</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <tasks>
                    <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                        <arg line="-uri wsdl/DTPSampleService.wsdl -u -uw -o target/generated -p org.wso2.carbon.dataservices.samples.dtp_sample -ns2p http://ws.wso2.org/dataservice/dtp_sample=org.wso2.carbon.dataservices.samples.types.dtp_sample" />
                        <classpath refid="maven.dependency.classpath" />
                        <classpath refid="maven.compile.classpath" />
                        <classpath refid="maven.runtime.classpath" />
                    </java>
                </tasks>
            </configuration>
        </execution>
    </executions>
</plugin>

当我运行它时,我得到如下调试日志

     [java]     DEBUG_FRAME = org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50)
     [java]     DEBUG_FRAME = org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:246)
     [java]     DEBUG_FRAME = org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
     [java]     DEBUG_FRAME = org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
     [java] 
     [java] [org.apache.axis2.description.ParameterIncludeImpl] DEBUG : ==================

有什么办法,我可以将日志级别更改为info。

我尝试了以下操作,但似乎无济于事

<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
    <jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog" />
    <jvmarg value="-Dorg.apache.commons.logging.simplelog.defaultlog=off" />
    <sysproperty key="org.apache.commons.logging.Log" value="org.apache.commons.logging.impl.SimpleLog"/>
    <sysproperty key="org.apache.commons.logging.simplelog.defaultlog" value="off"/>
    <arg line="-uri wsdl/RDBMSSample.wsdl -u -uw -o target/generated -p org.wso2.carbon.dataservices.samples.rdbms_sample -ns2p http://ws.wso2.org/dataservice/rdbms_sample1=org.wso2.carbon.dataservices.samples.types.rdbms_sample" />
    <classpath refid="maven.dependency.classpath" />
    <classpath refid="maven.compile.classpath" />
    <classpath refid="maven.runtime.classpath" />
</java>

0 个答案:

没有答案
相关问题