I need to configure Log4j 2.x logging with encryption key (AES). I have this part in the log4j2.xml
:
<Encryption keyId="${sd:encryptionKeyId}" key="${sd:encryptionKey}">
....
</Encryption>
For testing purposes, I used an online generation tool to generate an AES key and I put it directly there instead of ${sd:encryptionKey}
. It worked, ie. I didn't get any exceptions.
Then I wanted to move the key up to the properties, like so:
<Property name="sd:encryptionKey">---my key here---</Property>
It didn't work. I removed the sd:
prefix and it worked again.
My question is: What does this prefix stand for and is setting the key directly in this file as a property the right way to do it?