how to use java print log to different file

the log file name and the log directory can be defined in the code
before use the log code to print log information.
2013-8-19