Personally, I use log4j which allows you to configure all of this stuff from a properties file.
As to your question:
One thing to keep in mind is that a
Java webapp doesn't necessarily reside in a directory. They can also be deployed and run from a packed war archive.
The war file doesn't even need to be on the same machine.
The ServletContext.getRealPath method will find the file system path to any resource in your webapp. Using getRealPath("/") will find the root of your webapp. If, as mentioned earlier, your app hasn't been deployed as an exploded file system, get real path will return null.
For this reason, relying on getRealPath makes your webapp less portable.