Creating a Logging Appender

You can create a logging appender from the GUI or by using the CLI. Three types of appenders are supported: Clear Text File, CBE XML File, and JMS.

GUI

Procedure

  1. Select Shared Objects > Logging Appenders.
  2. Click New.
    The New Logging Appender dialog displays with the drop-down list of the logging appender type expanded.
  3. Select an appender type from the Type list.
    • JMS Appender - Append events to a log service.
    • CBE XML File Appender - Appends events to a file in Common Base Event (CBE) format.
    • Clear Text File - Appends events to a file in clear text format.
    The dialog redraws with the appender-specific fields.
  4. Accept the default name or type a name for the appender in the Name field.
  5. Fill in the fields and click Save.
    The appender is added to the Logging Appenders table and is selected.

Result



CLI

Procedure

  1. In the data file, specify the type of the appender in the xsi:type attribute. File Log Appender
    <LogAppender
    		xsi:type="amxdata:FileLogAppender"
      name="HelloWorldFileAppender"
      filePath="C:/amx-3admin/tibco/cfgmgmt/tibcohost/Admin-amxadmin-instanceOne/
    		nodes/DevNode/logs/HelloWorld.log"
      maxSize="10000" maxBackupNum="5"/>
    CBE File Appender
    <LogAppender xsi:type="amxdata:FileLogAppender"
      name="myFileLogAppender"
      description="This is File LogAppender"
      filePath="C:/amx-3admin/tibco/cfgmgmt/tibcohost/Admin-amxadmin-instanceOne/
    		nodes/DevNode/logs/HelloWorld-CBE.log"
      type="cbe"
      maxSize="1000"
      maxBackupNum="5"/>
    JMS Appender without payload support
    <LogAppender xsi:type="amxdata:JmsLogAppender"
      name="myJmsLogAppender"
      description="This is Jms LogAppender without payload support"
      jmsConnectionFactoryName="cl_logservice_jmsConnectionFactory" 
      jmsConnectionName="cl_logservice_jndiConnectionConfig"
      jmsDestination="cl_logservice_jmsConnectionDestionation"
      type="jndi"        
      sync="true"/>
    JMS Appender with payload support
    <LogAppender xsi:type="amxdata:JmsLogAppender"
      name="myJmsLogAppender"
      description="This is Jms LogAppender with payload support"
      jmsConnectionFactoryName="cl_logservice_jmsConnectionFactory" 
      jmsConnectionName="cl_logservice_jndiConnectionConfig"
      jmsDestination="cl_logservice_jmsConnectionDestionation"
      type="jndi"
      sync="true"             
      payloadURL="c:/payloadURL"
      sharedDiskURL="c:/sharedDiskURL"/>
  2. In the AMXAdminTask element, set the action attribute to add and the objectSelector attribute to LogAppender.
    <AMXAdminTask action="add" objectSelector="LogAppender"/>
  3. Invoke the command-line interface on the build file.

Result

Refer to Composite Development for information on how to retrieve log entries from the destination queue of a JMS appender.