logpath = LoggerUtils.getProperties().getProperty("log.path");
System.out.println("logpath: " + logpath);
The above code returns:
logpath: C:UsersMauriceDesktopLogs
In the properties file is:
log.path C:\Users\Maurice\Desktop\Logs
How do I retain the file separators? I want this to work on Linux as well and not just Windows.
Actually, you need to put this in the property file:
See this:
more precisely the
loadmethod:Scroll down a bit and you will see this among other things:
Backslash
\is an escape character that is silently dropped otherwise.