After the answer by Eric.Y.Fan didn't work, I played around a bit to find out why not.
I first put back the <connectionString>
value (I left it out of my post for clarity), and it did work. That proved that the correct <appender>
had been found, but that the correct <parameter>
was not being found. "Found", or "located". That was a hint.
I looked at the XPath expression, and realized that it was attempting to locate the <parameter>
which had a <parameterName>
with a value
attribute with the value @stackTrace
. So I tried using Condition
:
<parameter xdt:Locator="Condition([parameterName[@value='@stackTrace']])"
xdt:Transform="Replace">
</parameter>
This worked!
So the final transform is:
<parameter xdt:Locator="Condition([parameterName[@value='@stackTrace']])">
<size value="2000" xdt:Transform="Replace" />
</parameter>