while trying to run the log code it is showing org.apache.log4j.PropertyConfigurator...
i am unable to trace out the error.
here i am sending the code.
---------any helppackage logexmaples; import java.io.*; import java.text.*; import java.util.*; import java.net.URL; import org.apache.log4j.*; //import org.apache.log4j.properties; import org.apache.log4j.PropertyConfigurator.*; @SuppressWarnings("unused") public class SimpleLog2 { private static String logFile = "/msglog.txt"; private final static DateFormat df = new SimpleDateFormat ("yyyy.MM.dd hh:mm:ss "); private SimpleLog2() { } public static void setLogFilename(String filename) { logFile = filename; new File(filename).delete(); try { write("LOG file : " + filename); } catch (Exception e) { System.out.println(stack2string(e)); } } public static void write(String msg) { write(logFile, msg); } public static void write(Exception e) { write(logFile, stack2string(e)); } public static void write(String file, String msg) { try { Date now = new Date(); String currentTime = SimpleLog2.df.format(now); FileWriter aWriter = new FileWriter(file, true); aWriter.write(currentTime + " " + msg+ System.getProperty("line.separator")); System.out.println(currentTime + " " + msg); aWriter.flush(); aWriter.close(); } catch (Exception e) { System.out.println(stack2string(e)); } } private static String stack2string(Exception e) { try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); return "------\r\n" + sw.toString() + "------\r\n"; } catch(Exception e2) { return "bad stack2string"; } } }