Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Applications > Application Server > Issue <<  8 of 29 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 8803
Last update: 08-22-06
Issue:
How do I log JBoss output to a local or remote syslog server?
Resolution:

Here are the steps for logging the output to a remote syslog server:

  1. Edit the log4j.xml file in the conf directory of the server instance. For the default server instance edit the $JBOSS_HOME/server/default/conf/log4j.xml file.
  2. Uncomment the following xml:
    <!-- Syslog events
    <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
    <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
    <param name="Facility" value="LOCAL7"/>
    <param name="FacilityPrinting" value="true"/>
    <param name="SyslogHost" value="localhost"/>
    <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
    </layout>
    </appender>
    -->
    
    NOTE: Change localhost to any remote enabled syslog server.
    NOTE: The "LOCAL7" facility is arbitrary and can be modified to anything as long as the changes happen in both log4j.xml and /etc/syslog.conf files.
  3. Modify the following xml:
    <!-- ======================= -->
    <!-- Setup the Root category -->
    <!-- ======================= -->
    
    <root>
    <appender-ref ref="CONSOLE"/>
    <appender-ref ref="FILE"/>
    </root>
    

    Add the SYSLOG appender reference:

    <!-- ======================= -->
    <!-- Setup the Root category -->
    <!-- ======================= -->
    
    <root>
    <appender-ref ref="CONSOLE"/>
    <appender-ref ref="FILE"/>
    <appender-ref ref="SYSLOG" />
    </root>
    
  4. Modify /etc/syslog.conf to include the new LOCAL7 facility and where to create the log file:
    LOCAL7.* /var/log/jboss.log
    
  5. Restart syslog and jboss as:
    service syslog restart
    service jbossas restart
    


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Applications > Application Server > Issue <<   8  of  29  >>