title: Log4j2 MDC configuration for JDBC appender
body: <p>I have log4j2.xml file:</p>
  
  <pre><code>&lt;Console name="Console" target="SYSTEM_OUT"&gt;
     &lt;PatternLayout
              pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %X{userId} %-5level %logger{36}: %msg%n" /&gt;
  &lt;/Console&gt;
  </code></pre>
  
  <p>and there is <code>%X{userId}</code> part which allows me to display something from MDC (Thread Context).</p>
  
  <p>I have similar configuration for JDBC:</p>
  
  <pre><code>&lt;JDBC name="sqlServer" tableName="dbo.application_log"&gt;
          &lt;ConnectionFactory
              class="mbms.configuration.Log4j2ConnectionFactory"
              method="getConnection" /&gt;
          &lt;Column name="eventDate" isEventTimestamp="true" /&gt;
          &lt;Column name="level" pattern="%level" /&gt;
          &lt;Column name="logger" pattern="%logger" /&gt;
          &lt;Column name="user" pattern="%X{userId}" /&gt;
          &lt;Column name="message" pattern="%message" /&gt;
          &lt;Column name="exception" pattern="%ex{full}" /&gt;
  &lt;/JDBC&gt;
  </code></pre>
  
  <p>And it's not working. When I comment out user, logs are stored in database, but when it's there I got exception:</p>
  
  <pre><code>Caused by: java.sql.BatchUpdateException: Incorrect syntax near the keyword 'user'.
  at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2065)
  at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:2544)
  at org.apache.logging.log4j.core.appender.db.jdbc.JdbcDatabaseManager.commitAndClose(JdbcDatabaseManager.java:532)
  ... 108 more
  </code></pre>
  
  <p>Do you know how I can use <code>%X{userId}</code> to store this information in MS SQL database?</p>