Log

Log component is a visual console to display logs of PrimeFaces. Using log client side API, you can also use the component.

    Client Side API

    Ajax Request

    Source

    <p:log />
                
    <h3>Client Side API</h3>
    <p:commandButton type="button" value="Info" onclick="PrimeFaces.info('This is an info message.')" />
    <p:commandButton type="button" value="Warn" onclick="PrimeFaces.warn('This is a warn message.')" />
    <p:commandButton type="button" value="Debug" onclick="PrimeFaces.debug('This is a debug message.')" />
    <p:commandButton type="button" value="Error" onclick="PrimeFaces.error('This is an error message.')" />
    
    <h3>Ajax Request</h3>
    <h:form id="frm">
    
        <h:panelGrid columns="4" cellpadding="5">
            <h:outputLabel for="name" value="Name:" style="font-weight:bold"/>
    
            <p:inputText id="name" value="#{pprBean.firstname}" />
    
            <p:commandButton value="Submit" update="display"/>
    
            <h:outputText value="#{pprBean.firstname}" id="display" />
        </h:panelGrid>
    
    </h:form>