使用.log4j.properties.xml文件显示真实的sql(问号)

时间:2018-10-25 13:37:03

标签: xml hibernate log4j properties-file

我正在尝试将log4j.properities转换为.xml文件中的等效文件,但是它似乎无法正常工作,而且我仍然像往常一样获得带问号的SQL语句

我需要知道如何正确转换它们。 这是我的xml文件

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%-4r [%t] %-5p %c{2} %x - %m%n"/>
        </Console>
        <RollingFile name="DmWebAdminDailyRollingFile"
                     append="true"
                     fileName="C:/TMP/logs/Current-DPM-WebAdministrator.log"
                     filePattern="C:/TMP/logs/DPM-WebAdministrator.%d{yyy-MM-dd}.%i.log"
                     immediateFlush="true">
            <PatternLayout pattern="%-5p %d{ISO8601} [%t] -- [%X{remoteIP}] - %C.%M - %m%n"/>
            <Policies>
                <SizeBasedTriggeringPolicy size="16 MB" />
                <TimeBasedTriggeringPolicy/>
            </Policies>
            <DefaultRolloverStrategy max="16">
                <Delete basePath="C:/TMP/logs/" maxDepth="1">
                    <IfFileName glob="DPM-WebAdministrator.*.log" />
                    <IfLastModified age="1d" />
                </Delete>
            </DefaultRolloverStrategy>
        </RollingFile>      
    </Appenders>
    <Loggers>
        <logger name="org.hibernate.type">
            <level value="TRACE"/>
        </logger>
        <logger name="org.hibernate.SQL">
            <level value="DEBUG"/>
        </logger>
        <logger name="org.hibernate.jdbc">
            <level value="debug"/>
        </logger>
        <logger name="org.hibernate.hql">
            <level value="debug"/>
        </logger>   
        <logger name="org.hibernate.hql.ast.AST">
            <level value="info"/>
        </logger>
        <logger name="org.hibernate.cache">
            <level value="info"/>
        </logger>
        <logger name="org.hibernate.type">
            <level value="TRACE"/>
        </logger>
        <Logger name="de.dps.ecms" level="DEBUG" additivity="false">
            <AppenderRef ref="DmWebAdminDailyRollingFile"/>
        </Logger>
        <Logger name="de.dps.dpm" level="DEBUG" additivity="false">
            <AppenderRef ref="DmWebAdminDailyRollingFile"/>
        </Logger>
        <Logger name="org.hibernate" level="ERROR" additivity="false">
            <AppenderRef ref="DmWebAdminDailyRollingFile"/>
        </Logger>
        <Logger name="org.apache.tapestry5" level="INFO" additivity="false">
            <AppenderRef ref="DmWebAdminDailyRollingFile"/>
        </Logger>
        <Logger name="org.hibernate.cache" level="ERROR" additivity="false">
            <AppenderRef ref="DmWebAdminDailyRollingFile"/>
        </Logger>
        <Logger name="org.hibernate.transaction" level="ERROR" additivity="false">
            <AppenderRef ref="DmWebAdminDailyRollingFile"/>
        </Logger>
        <Logger name="org.hibernate.SQL" level="ERROR" additivity="false">
            <AppenderRef ref="DmWebAdminDailyRollingFile"/>
        </Logger>
        <Root level="INFO">
            <AppenderRef ref="DmWebAdminDailyRollingFile"/>
        </Root>
    </Loggers>
</Configuration>

我发现this site应该将常规属性转换为xml表单,但页面没有响应。

0 个答案:

没有答案