Upgrading LogStash Log4j configuration to Log4j2
<p>I am trying to migrate my Spring Boot app from Log4j to Log4j 2. I understand the Log4j 2 changed the syntax of <code>.properties</code> configurations from the original Log4j.  </p>

<p>Here is a snippet of my original Log4j configuration:</p>

<pre><code>log4j.appender.logstash=org.apache.log4j.net.SocketAppender
log4j.appender.logstash.layout=org.apache.log4j.PatternLayout
log4j.appender.logstash.layout.ConversionPattern=%d{HH:mm:ss.SSS} %-5p %c {2} %x - %m%n
log4j.appender.logstash.Port=4560
log4j.appender.logstash.RemoteHost=logs.example.com
log4j.appender.logstash.ReconnectionDelay=10000
</code></pre>

<p>and here is what I updated it to, for Log4j 2:</p>

<pre><code>appender.logstash.type=SocketAppender # Or 'Socket'
appender.logstash.name=logStash
appender.logstash.layout.type=PatternLayout
appender.logstash.layout.pattern=%d{HH:mm:ss.SSS} %-5p %c {2} %x - %m%n
appender.logstash.host=logs.example.com
appender.logstash.port=4560
appender.logstash.reconnectionDelayMillis=10000
</code></pre>

<p>However, when I do this, my console and file appenders work just fine,  but the LogStash appender throws a <code>Broken pipe</code> error. </p>

<p>I've looked into this an it seems that I may need to wrap the <code>SocketAppender</code> in an <code>AsyncAppender</code> and pointing the <code>ref</code> towards my <code>logStash SocketAppender</code> (as in <a href="https://logging.apache.org/log4j/2.x/manual/appenders.html" rel="nofollow">this documentation</a>), but then I get exceptions that the properties do not exist:
appender.async.type=Async
appender.async.ref=logStash # Or 'refs', 'appender-ref', etc.</p>

<p>Is a <code>.properties</code> file not the way to go for Async Socket Appenders?  I could use some help in migrating from Log4j 1 to 2 via this properties file.</p>