1
votes

After following the instructions on the following pages:

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

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

I have generated my log4j.xml and properties-local.xml files according the the instructions on the pages above and inserted them into the $TOMCAT_HOME/webapps/orbeon/WEB-INF/resources/config directory.

After restarting tomcat and building a few forms with the builder, I have been unable to locate any log information. There is no orbeon.log file on my system and no orbeon information in my tomcat log files either. Additionally I have run tomcat in debug mode to use remote debugging in IntelliJ and receive no output to the console.

I'm building the webapp myself using IntelliJ with the latest on https://github.com/orbeon/orbeon-forms/tree/4.0.0.m10-ce currently commit 51f0e8f1b396336c612c16655e39abe6b807214b

I'm using Ubuntu 12.04 and running orbeon in Tomcat6.

I'm very new to orbeon development so I'm hoping the problem is something simple. Any help would be greatly appreciated. Thanks.

Update:

I tried setting up the logger for an absolute path with no results, here is my current configuration (except with actual absolute paths).

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>

properties-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>

Update2

Following some of the suggestions, I've ensured that write permissions is not the issue. I've also tried using the ConsoleAppender and still got no output, but the webapp also crashed after a few minutes and I found this exception in the tomcat log files.

WARNING: Cannot serialize session attribute orbeon.resources.dynamic.cb088a8a347ad72a00012a9d8569b5e9c5dd6381 for session 29AE194AA69E0D51C111F5035C219E7B

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)
2
It might also be an issue of permissions. Try setting the path to a file in an existing directory with write access from any user, at least to rule out that this is an issue. - ebruchez
I've tried this and it does not seem to be the issue. - user1715357
What do you mean by "the webapp also crashed"? The exception you see there is a warning from Tomcat regarding a non-serializable item in the session. Ideally it shouldn't happen but it's not related to the logging issue. - ebruchez
After I made a form and messed with the orbeon web page a bit, it all of a sudden stopped running. The orbeon pages showed up as 404's from tomcat and the tomcat manager showed orbeon as not running. The warning is just the only thing I could find in the log files that had anything to do with Orbeon. - user1715357
Does the Orbeon home page load at all? E.g. by default http://localhost:8080/orbeon/? - ebruchez

2 Answers

1
votes

The logs folder should be available inside Tomcat folder if you declare log4j as below

<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>

and

<!-- 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>

If you have simply placed the Orbeon war file in webapps folder, then i suggest to remove the .war file once the server is started. After server start, tomcat unpacks the war and creates a folder. If .war is not removed everytime you restart the tomcat server, it will unpack and overwrites in the same folder again.

0
votes

With the default log4j.xml, the SingleFileAppender is being used, and the file it writes to is referenced using a relative path:

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

So the location of the file on disk will depend on the directory from which you start Tomcat. It is not uncommon to start Tomcat from its bin directory, in which case the log file will end up in Tomcat's logs directory. But if you're starting Tomcat from a different location, or would like the log file to end up in the different directory, you can edit your log4j.xml and put there an absolute path to the orbeon.log.