Having mapping issues when trying to save monolog logs into Elasticsearch use ElasticsearchHandler
<p>I'm trying to start sending my logs into elastic search using monolog. (I'm using Symfony2). </p>

<p>I've set up monolog like this:</p>

<pre><code>monolog:
    handlers:
        elasticsearch:
            elasticsearch:
                host: %logger_elastic_host%
                port: %logger_elastic_port%
            type: elasticsearch
            level: info
</code></pre>

<p>It worked only few minutes until it broke with this error messages(a fatal error, I removed useless stuff):</p>

<blockquote>
  <p>create: /monolog/logs/AVQKYsGRPmEhlo7mDfrN caused
  MapperParsingException[failed to parse [context.stack.args]]; nested:
  ElasticsearchIllegalArgumentException[unknown property [class]];</p>
</blockquote>

<p>I've been looking with my collegue how to fix that. What we found out is:</p>

<ul>
<li>Elastic search receive the first logs and automatically build a mapping</li>
<li>We send new logs with another mapping or slightly different to what was sent before and it breaks.</li>
<li>In this case it's breaking here: context.stack.args.</li>
</ul>

<p>The problem is that the context will always be very different.</p>

<p>What we would like is:</p>

<ol>
<li><p>is anyone out there using Monolog to log to Elasticsearch </p></li>
<li><p>How do you guys manage to avoid this issue. (How can we manage to avoid it)?</p></li>
</ol>

<p>thanks guys.</p>