title: Connect remote server for logging using Log4J
body: <p>I want To Connect to the remote server to write my log files using Log4J Socket Appender
  My log.properties file is as below</p>
  
  <pre><code>log4j.rootLogger=DEBUG, BLAH
  
  # to connect to the remote server
  log4j.appender.BLAH=org.apache.log4j.net.SocketAppender
  
  # set set that layout to be SimpleLayout
  log4j.appender.BLAH.layout=org.apache.log4j.SimpleLayout
  
  #log4j.appender.BLAH.File= admin.log
  
  log4j.appender.BLAH.Port= xx
  log4j.appender.BLAH.RemoteHost= &lt;remoteIp&gt;
  </code></pre>
  
  <p>I tried connecting localhost too with port number 22 and 8080</p>
  
  <p>I am making a mistake some where in the connection .
  I get the following error </p>
  
  <pre><code>log4j:ERROR Could not connect to remote log4j server at [localhost]. We will try again later.
  </code></pre>
  
  <p>or 
  Give me any suggestions to write the log files in a remote server machine.</p>