I want to have following format in my log file in Log4j
{date:yyyy-MM-dd HH:mm:ss:SSS} {level} [{thread name- thread Id}]:[{file}:{line}] {message}
How do I go about it?
I want to have following format in my log file in Log4j
{date:yyyy-MM-dd HH:mm:ss:SSS} {level} [{thread name- thread Id}]:[{file}:{line}] {message}
How do I go about it?
You should take a look to the javadoc about the pattern layout. You can find the javadoc for log4j 1.2.17 here.
However, I would recommend you to use Apache Log4j2 (even if it is currently in beta) or LogBack. Log4j2 provides many more options to do different pattern layouts, you can check it here