XForms logging
Enabling XForms logging
Sometimes, an error message or stack trace in the Orbeon Forms log file provides enough information to a developer to figure out what went wrong, but not always. In such cases, you can turn to the XForms engine logging facility. To enable it, make sure you uncomment the following logging <Logger>
(Log4j 2.x) or <Category>
(Log4j 1.x):
Log4j 2.x (WEB-INF/resources/config/log4j2.xml
):
Log4j 1.x (WEB-INF/resources/config/log4j.xml
):
Note: You must restart your Servlet container for those changes to be taken into account.
Fine-grained configuration
Two properties in WEB-INF/resources/config/properties-local.xml
control exactly what is logged by the XForms engine:
oxf.xforms.logging.debug
controls what is logged at debug level:
Related to a particular XForms document:
model
activity related to
xf:model
, including instance loads, validation, and binds
submission
timing activity related to
xf:submission
submission-details
detail activity related to
xf:submission
requires
submission
to be present as well
control
activity related to controls
event
activity related to events dispatching and propagation
action
activity related to XForms actions
document
other activity related to an XForms document
this includes the output of the
<xf:message>
action with levelxxf:log-debug
process
activity related to processes
Not related to a particular XForms document:
analysis
activity related to the static analysis of an XForms document
server
activity related to handling Ajax requests
html
activity related to converting XForms to HTML
resources
activity related to handling XForms CSS and JavaScript resources
state
activity related to state handling
resolver
activity related to the URI resolver
utils
miscellaneous activity
cache
[SINCE Orbeon Forms 4.6]
activity of the static state cache during XForms initialization
Data:
html-static-state
requires
html
outputs the static state input
analysis-xbl-tree
requires
analysis
outputs the detail of the XBL shadow trees computed
submission-body
requires
submission
ANDsubmission-details
outputs the detail of submission request/response bodies
model-serialized-instance
requires
model
outputs the full instances serialized into the dynamic state after an Ajax request completes
server-body
requires
server
outputs the full Ajax request and response bodies
oxf.xforms.logging.error
controls what is logged at error level:
submission-error-body
Whether to attempt to output a submission response body when a submission error occurs
This is enabled by default, but you can turn it off, e.g. for data sensitivity reasons
Binary bodies are not logged, but the logger mentions that the type is a binary type
When the response body is NOT logged and is used for
replace="instance|all"
, streaming is taking place. However when the response body IS logged, streaming does not take place:The body is read in memory
The body is logged
Then the rest of the submission proceeds
server-body
output the Ajax request in case of error occurring while processing the request
Development configuration
During XForms development, you might want to enable a more aggressive debug configuration.
Change your Log4j2 or Log4j configuration. In your
WEB-INF/resources/config
, check if you have a file namedlog4j2.xml
orlog4j.xml
:If you have a file named
log4j2.xml
(with2
in the file name), inside the element<Loggers>
, add:If you have a file named
log4j.xml
(without2
in the file name), uncomment the following:
Configure the
oxf.xforms.logging.debug
property in yourconfig/properties-local.xml
. You can choose precisely what the XForms engine logs. The following is the most comprehensive configuration. It will log almost everything. In most cases, this is a good configuration during development, and while troubleshooting issues in staging:
Production configuration
No debug output
In production, you probably don't want any debug information coming out to your logs. So set this in log4j.xml
:
Alternatively, remove or comment-out the lines above. When this is done, the oxf.xforms.logging.debug
property is no longer used, so it does not matter what it contains. However, the oxf.xforms.logging.error
is still relevant. Configure it appropriately, depending on whether you want to see submission responses bodies logged or not.
Just submission timings
If you only want to see submission timings, in your log4j.xml
use:
And in your properties-local.xml
:
Example output
The following shows a sample XForms logging session:
See also
Last updated