I had develioped a application where inserting datas from Excel sheet to database.My problem is that when ever a duplicate value is developed either in database or excel sheet , i have to create a log file file and that duplicate value has to written in that log file.I had written the logic for printing the duplicate values in servlet using out.println. but i dont know how to create log file and to write this duplicate values there. Kindly help me.
The link I gave directly pointing to the manual page which describes how to configure log4j. If you have downloaded the log4j distribution it also contains that under "site" folder once you extract it. BTW, I don't have any problem with the link.
I had a similar scenario and in my case I could not use log4j as I need to show the logs of import in a separate file.
In created a separate JAVA class which does importing, so I just call the import method in the class with the filename as parameter which adds all the log values either success or failed (starts with "INFO:" if succeeds and starts with "ERROR:" if fails) and this method returns the arraylist to the calling servlet.
In my servlet I just loop around the arraylist and print it to the brower (which shows only errors) and a log file (which captures all).