Ravi Kiran V wrote:I want to have all these statements inside a File.
Sorry, which "statements" do you want to have inside a file? Your configuration will already be in a file, so it isn't clear what you mean by that sentence.
Okay. You really mean "How can I get the logging output from these statements into a file", right? You don't want the Java statements to be in a file, do you?
You will find programming is easier if you express yourself clearly. If you can't express what you want to do, you won't be able to write a program to do that.
But anyway, back to the question. Your properties file specifies a ConsoleAppender and nothing else. That's why the logging output goes to the console and nowhere else. If you want it to go to a file then you need to specify a FileAppender in the properties file.