6.13.  < a4j:log >

6.13.1. Description

The <a4j:log > component generates JavaScript for opening of the window with client-side debug information on an Ajax request.

Table 6.25. a4j : log attributes

Attribute NameDescription
bindingThe attribute takes a value-binding expression for a component property of a backing bean
dirDirection indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left)
heightheight of pop-up
hotkeyKeyboard key for activate ( in combination with CTRL+SHIFT ) log window.
idEvery component may have a unique id that is automatically created if omitted
langCode describing the language used in the generated markup for this component
levellog level, possible values : FATAL,ERROR,WARN,INFO,DEBUG,ALL. Component set level 'ALL' by default.
namename of pop-up window
onclickHTML: a script expression; a pointer button is clicked
ondblclickHTML: a script expression; a pointer button is double-clicked
onkeydownHTML: a script expression; a key is pressed down
onkeypressHTML: a script expression; a key is pressed and released
onkeyupHTML: a script expression; a key is released
onmousedownHTML: script expression; a pointer button is pressed down
onmousemoveHTML: a script expression; a pointer is moved within
onmouseoutHTML: a script expression; a pointer is moved away
onmouseoverHTML: a script expression; a pointer is moved onto
onmouseupHTML: script expression; a pointer button is released
popupRender log as popup-window or as div element in page
renderedIf "false", this component is not rendered
styleCSS style(s) is/are to be applied when this component is rendered
styleClassCorresponds to the HTML class attribute
titleAdvisory title information about markup elements generated for this component
widthwidth of pop-up.

Table 6.26. Component identification parameters

NameValue
component-typeorg.ajax4jsf.Log
component-familyorg.ajax4jsf.Log
component-classorg.ajax4jsf.component.html.AjaxLog
renderer-typeorg.ajax4jsf.LogRenderer

6.13.2. Creating the Component with a Page Tag

To create the simplest variant on a page use the following syntax:


<a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"></a4j:log>

Then, in order to open a log window, press "CTRL+SHIFT+L" on a page with the component.

6.13.3. Creating the Component Dynamically Using Java

Example:


import org.ajax4jsf.component.html.AjaxLog;
...
AjaxLog myLog = new AjaxLog();
...

6.13.4. Key attributes and ways of usage

Usage of the appropriate component attributes could change a representation level of debug information as well as the hot key for a window opening.

The hot key could be changed with the "hotkey" attribute, where it's necessary to define one letter that together with "CTRL+SHIFT" opens a window.

The "level" attribute with several possible values (FATAL, ERROR, WARN, INFO, ALL) could change a logging level.

The log could be generated not only in a new window, but also on the current page in a separate <div> , this is also controlled with the "popup" attribute on the component.

Example:


<a4j:log level="ALL" popup="false" width="400" height="200"/>

The component defined this way is decoded on a page as <div> inside a page, where all the information beginning with informational message is generated.

Note:

<a4j:log> is getting renewed automatically after execution of Ajax requests. Don't renew <a4j:log> by using reRender!

6.13.5. Relevant resources links

Here you can see the example of <a4j:log> usage and sources for the given example.