How to create log file in an existing directory ?..I have tried out this code:
String fileName = "/log/ABC.log";
FileHandler fileHandler = new FileHandler(fileName, true);
But it is not working.Here log is the directory…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should take a look at the Logger class which is part of Java (since version 1.4). The FileHandler class is part of the logging package and it relies on the Logger class to actually log the errors to the FileHandler object you create.