carterkozak commented on pull request #732:
URL: https://github.com/apache/logging-log4j2/pull/732#issuecomment-1029409723
I’m having a bit of an internal struggle with this — in its current state,
it changes the behavior of `$${ctx:foo}` used in properties because today we
build properties using substitution, such that the escapement is dropped when
the property is built: `${ctx:foo}`, then when the property is referenced,
recursive evaluation will then evaluate `${ctx:foo}` (assuming recursive
evaluation is allowed)
My change modifies the behavior so that substitution is allowed through
properties recursively, but no other lookups, so when the Property is initially
constructed, it retains the `$${ctx:foo}` value, and when it’s referenced, the
value is expanded to `${ctx:foo}`.
I am convinced the new behavior is better, and easier to reason about.
However, changes impacting config are bad. That said, this fixes an issue in
which lookup-shaped data in sources used by the configuration are unexpectedly
evaluated (e.g. `env:FOO` where FOO includes something like `${java:version}`)
We can play some dirty tricks to minimize impact, however that sort of thing
will more than likely come back to haunt us. I can do a `value.replace("$${",
"${")` on the raw value to simulate the old behavior, such that old configs
continue to work, however there are edge cases in which literal `$${` won’t
work as one might expect.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]