0 Replies Latest reply on Sep 10, 2007 2:52 AM by LeQuoc Thai

    Problem about using SocketAppender !!

    LeQuoc Thai Novice

      Hi all!
      I use

      jboss-4.0.5.GA, EJB3.0 XP_SP2

      I use
      Log4jSocketServer and SocketAppender
      to log some request from clients to server. (Example both of server and client is the same machine, and host name: pc6 and has IP is: 192.168.1.228 ).
      Ok, inside server\default\conf\jboss-service.xml, I added:
      ...
      <mbean code="org.jboss.logging.Log4jSocketServer"
       name="jboss.system:type=Log4jService,service=SocketServer">
       <attribute name="Port">8888</attribute>
       <attribute name="BindAddress">${jboss.bind.address}</attribute>
      </mbean>


      Then, inside server\default\conf\log4j.xml, I added:
      ...
      <appender name="MY_SOCKET" class="org.apache.log4j.net.SocketAppender">
       <param name="Port" value="8888"/>
       <param name="RemoteHost" value="pc6"/> --> or "192.168.1.228"
       <param name="ReconnectionDelay" value="30000"/>
       <param name="Threshold" value="INFO"/>
      </appender>


      But when I restart JBoss Server, I received some errors:
      log4j:ERROR Could not connect to remote log4j server at [pc6]. We will try again later.
      java.net.ConnectException: Connection refused: connect
       at java.net.PlainSocketImpl.socketConnect(Native Method)
       at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      ...


      Please guid to me how way fixed my errors. (Sorry, my English is not good.)
      Thanks very much.