In my log4j2.xml file, I get the complete path of the logfile by passing a system property
-Dlogfilename=/home/user/logs/server
Log4j2 configuration:
<Property name="logFile">${sys:logfilename:-/home/user/logs/server}</Property>
As an added requirement, I need to get the name of the log file from the above property and I cannot pass a new system property. How can I get just the name of the file from the complete path? I dont have any experience with XML other than its use for data transport.
See Question&Answers more detail:os