0 Replies Latest reply on Oct 27, 2014 3:32 AM by Ruchira Gayan Ranaweera

    Configure SocketAppender in Jboss

    Ruchira Gayan Ranaweera Newbie

      Hi all, I am trying to get Error logs as soon as they occurred. So I want to use SocketAppender in order to get Error logs. I used following configuration in standalone.xml  

      <custom-handler name="SOCKET" class="org.apache.log4j.net.SocketAppender" module="org.apache.log4j">

                      <level name="ERROR"/>

                      <formatter>

                          <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                      </formatter>

                      <properties>

                          <property name="remoteHost" value="localhost"/>

                          <property name="port" value="9500"/>

                      </properties>

                  </custom-handler>

      But  when i try to get log messages from socket connection I got java.io.InvalidClassException: org.apache.log4j.spi.LoggingEvent; class invalid for deserialization.

       

      I am still trying to sort this out. Any help highly appreciated. Note: I couldn't find a good way to use custom log appenders in Jboss.

      I have use Log4j SocketAppender for stand alone application which worked perfect.

       

      Why we can't use SocketAppender(custom appender ) easy? I am using Jboss AS7.

       

      Is there any easy way to achieve my goal. ultimate target is get Error log in real time to my monitor. (need to send from jboss application server to my monitor app in other pc. there are some other standalone components well. They are sending there error logs to my monitor, currently this part is working fine.@@)

       

      Thanks and Regards

      Ruchira