Thanks for your responses. They both resolve the issue I had.

On 18/11/2022, 16.48, "Piotr P. Karwasz" <piotr.karw...@gmail.com> wrote:

    Hi Stig,

    On Fri, 18 Nov 2022 at 11:03, Stig Døssing
    <stig.doess...@crowdstrike.com.invalid> wrote:
    > Is there a way to disable this “permanent substitution” and get log4j to 
do the system property lookup for every log event, even if there is a default 
value? If not, should there be? System properties can be changed from inside 
the application, so it seems strange to assume that if a system property has a 
value during logging init, it will keep that same value permanently.

    The `${...}` placeholders are replaced at configure time. If no value
    is available, they are left as is (this is IMHO a bug).

    If you want to evaluate the lookup at each logging event, just escape
    the dollar sign: `$${sys:testProperty}`. At configuration time one
    dollar sign will be stripped, so that the lookup will be performed at
    every logging event.

    Piotr

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
    For additional commands, e-mail: log4j-user-h...@logging.apache.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to