1

按照以下页面上的说明进行操作后:

http://wiki.orbeon.com/forms/doc/developer-guide/xforms-logging

http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties

我已经根据上面页面上的说明生成了我的 log4j.xml 和 properties-local.xml 文件,并将它们插入到$TOMCAT_HOME/webapps/orbeon/WEB-INF/resources/config目录中。

重新启动tomcat并使用builder构建了一些表单后,我一直无法找到任何日志信息。我的系统上没有 orbeon.log 文件,我的 tomcat 日志文件中也没有 orbeon 信息。此外,我在调试模式下运行 tomcat 以在 IntelliJ 中使用远程调试,并且没有接收到控制台的输出。

我正在使用 IntelliJ 自己构建 webapp,最新的https://github.com/orbeon/orbeon-forms/tree/4.0.0.m10-ce 目前提交 51f0e8f1b396336c612c16655e39abe6b807214b

我正在使用 Ubuntu 12.04 并在 Tomcat6 中运行 orbeon。

我对 orbeon 开发非常陌生,所以我希望问题很简单。任何帮助将不胜感激。谢谢。

更新:

我尝试将记录器设置为没有结果的绝对路径,这是我当前的配置(实际绝对路径除外)。

log4j.xml

<!-- This is the standard log appender to the console (System.out) -->
<appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
    <param name="Target" value="System.out"/>
    <param name="Encoding" value="UTF-8"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ISO8601} %-5p %c{1} %x - %m%n"/>
    </layout>
    <filter class="org.apache.log4j.varia.LevelRangeFilter">
        <param name="LevelMin" value="debug"/>
    </filter>
</appender>

<!-- Logging to a single file, typically used in development when you don't want
     to be dealing with multiple files generated by the RollingFileAppender.
     See: http://logging.apache.org/log4j/docs/api/org/apache/log4j/FileAppender.html -->
<appender name="SingleFileAppender" class="org.apache.log4j.FileAppender">
    <param name="File" value="/Absolute_Path_To_$TOMCAT_HOME/logs/orbeon.log"/>
    <param name="Append" value="false" />
    <param name="Encoding" value="UTF-8"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ISO8601} %-5p %c{1} %x - %m%n"/>
    </layout>
</appender>

<!-- Logging to a rolling files. Every time the file exceeds a certain size, a backup
     is created and the file used for logging is truncated.
     See: http://logging.apache.org/log4j/docs/api/org/apache/log4j/RollingFileAppender.html -->
<appender name="RollingFileAppender" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="../logs/orbeon.log"/>
    <param name="MaxFileSize" value="5MB"/>
    <param name="maxBackupIndex" value="200"/>
    <param name="Append" value="false" />
    <param name="Encoding" value="UTF-8"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ISO8601} %-5p %c{1} %x - %m%n"/>
    </layout>
</appender>

<!-- XForms engine activity, see http://wiki.orbeon.com/forms/doc/developer-guide/xforms-logging -->

<category name="org.orbeon.oxf.xforms.processor.XFormsServer">
    <priority value="debug"/>
</category>

<!-- To enable logging for any of the sub-systems below, copy that section outside of the comment block -->

<category name="org.orbeon.oxf.properties.Properties">
    <priority value="debug"/>
</category>

<category name="org.orbeon.oxf.processor.pipeline.TeeProcessor">
    <priority value="debug"/>
</category>

<category name="org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor">
    <priority value="debug"/>
</category>

<category name="org.orbeon.oxf.processor.generator.URLGenerator">
    <priority value="debug"/>
</category>

<category name="org.orbeon.oxf.processor.xmldb.XMLDBProcessor">
    <priority value="debug"/>
</category>

<category name="org.orbeon.oxf.processor.sql.SQLProcessor">
    <priority value="debug"/>
</category>

<category name="org.orbeon.oxf.processor.PageFlowControllerProcessor">
    <priority value="debug"/>
</category>

<category name="org.orbeon.oxf.processor.generator.RequestGenerator">
    <priority value="debug"/>
</category>

<category name="org.orbeon.oxf.webapp.OPSSessionListener">
    <priority value="info"/>
</category>

<category name="org.orbeon.oxf.webapp.OPSServletContextListener">
    <priority value="info"/>
</category>
<!---->

<!-- Prevent extra display of eXist paging activity -->
<category name="org.exist.storage.btree.Paged">
    <priority value="warn"/>
</category>

<category name="org.exist.storage.DBBroker">
    <priority value="warn"/>
</category>

<category name="org.exist.storage.BrokerPool">
    <priority value="warn"/>
</category>

<!-- You decide here which one of the loggers listed above you want to use. -->
<root>
    <priority value="info"/>
    <!--<appender-ref ref="ConsoleAppender"/>-->
    <!--<appender-ref ref="ChainsawAppender"/>-->
    <appender-ref ref="SingleFileAppender"/>
    <!--<appender-ref ref="RollingFileAppender"/>-->
</root>

属性-local.xml

<properties xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:oxf="http://www.orbeon.com/oxf/processors">
    <property as="xs:NMTOKENS" name="oxf.xforms.logging.debug" 
        value="document model submission control event action analysis server server-body html submission-details submission-body"/>
</properties>

更新2

根据一些建议,我确保写权限不是问题。我也尝试过使用 ConsoleAppender 仍然没有输出,但是几分钟后 webapp 也崩溃了,我在 tomcat 日志文件中发现了这个异常。

警告:无法为会话 29AE194AA69E0D51C111F5035C219E7B 序列化会话属性 orbeon.resources.dynamic.cb088a8a347ad72a00012a9d8569b5e9c5dd6381

java.io.NotSerializableException: scala.collection.JavaConversions$MapWrapper
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1585)
    at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:1015)
    at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:528)
    at org.apache.catalina.session.StandardManager.unload(StandardManager.java:469)
    at org.apache.catalina.session.StandardManager.stop(StandardManager.java:678)
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4882)
    at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:936)
    at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1359)
    at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1330)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:326)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1098)
    at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1110)
    at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
    at org.apache.catalina.core.StandardService.stop(StandardService.java:604)
    at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:662)
    at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:706)
4

2 回答 2

1

如果您如下声明 log4j,则日志文件夹应该在 Tomcat 文件夹中可用

<appender name="SingleFileAppender" class="org.apache.log4j.FileAppender">
    <param name="File" value="../logs/orbeon.log"/>
    <param name="Append" value="false" />
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ISO8601} %-5p %c{1} %x - %m%n"/>
    </layout>
</appender>

<!-- You decide here which one of the loggers listed above you want to use. -->
<root>
    <priority value="debug"/>
    <!--<appender-ref ref="ConsoleAppender"/>-->
    <!--<appender-ref ref="ChainsawAppender"/>-->
    <appender-ref ref="SingleFileAppender"/>
    <!--<appender-ref ref="RollingFileAppender"/>-->
</root>

如果您只是将 Orbeon 战争文件放在 webapps 文件夹中,那么我建议在服务器启动后删除 .war 文件。服务器启动后,tomcat 解包战争并创建一个文件夹。如果每次重启 tomcat 服务器时都没有删除 .war,它将再次解压并覆盖在同一个文件夹中。

于 2012-10-03T05:33:25.597 回答
0

使用 default log4j.xmlSingleFileAppender正在使用 ,并且它写入的文件使用相对路径引用:

<param name="File" value="../logs/orbeon.log"/>

因此,文件在磁盘上的位置将取决于您启动 Tomcat 的目录。从其bin目录启动 Tomcat 并不少见,在这种情况下,日志文件将在 Tomcat 的logs目录中结束。但是,如果您从不同的位置启动 Tomcat,或者希望日志文件在不同的目录中结束,您可以编辑您的log4j.xml并在其中放置orbeon.log.

于 2012-10-03T01:14:25.967 回答