title: Using nlog replace layout renderer, replacement seems to be done twice instead of once
body: <p>I'm attempting to use the NLog Replace Layout Renderer (<a href="https://github.com/NLog/NLog/wiki/Replace-Layout-Renderer" rel="nofollow noreferrer">https://github.com/NLog/NLog/wiki/Replace-Layout-Renderer</a>). I want to use it to truncate over-long messages. It seems to be able to do so, but replacement happens twice rather than once.</p>
  <p>In my nlog.config, I'm using the following:</p>
  <pre><code>&lt;variable name=&quot;replaced_message&quot; value=&quot;${replace:searchFor=.*:replaceWith=Replaced:regex=true:inner=${message}}&quot;/&gt;
  
  &lt;target name=&quot;filelog&quot; xsi:type=&quot;File&quot; fileName=&quot;${basedir}/../logs/webapp/${shortdate}.log&quot;
      layout=&quot;${date:format=yyyy-MM-dd HH\:mm\:ss.fff}|${level:uppercase=true}|${machinename}|T:${threadid}|${logger}|${replaced_message}&quot;/&gt;
  </code></pre>
  <p>And I'm getting log entries like:</p>
  <pre><code>2015-03-04 13:41:14.337|INFO|T:11|ReplacedReplaced
  </code></pre>
  <p>Does anyone have an idea why the message is &quot;ReplaceReplaced&quot; rather than &quot;Replaced&quot;?</p>