For performance wise what is better to use to include the class name in the log? In the pattern layout it gives a warning in the documentation for %F saying:
Used to output the file name where the logging request was issued.
WARNING Generating caller location information is extremely slow and should be avoided unless execution speed is not an issue.
To get the className log4j makes a call something like.
As you can see this does a lot of work for a simple result. Using getClass().getSimpleName() is relatively more efficient, but if you can cache this it would be better.
HotSpot internally has this method, which I believe is not used as it’s internal use only. IMHO, it would have been better if it detected if this were available and use it if it is.