Dec 8, 2005 #1 lipi123 Programmer May 1, 2005 2 US Hi, How to write exceptions in a log file. Can anybody give me a sample file. Thanks
Dec 8, 2005 #2 sedj Programmer Aug 6, 2002 5,610 ex.printStackTrace(outputStream); where ex is your exception object, and outputStream is a FileOutputStream previously opened. -------------------------------------------------- Free Java/J2EE Database Connection Pooling Software http://www.primrose.org.uk Upvote 0 Downvote
ex.printStackTrace(outputStream); where ex is your exception object, and outputStream is a FileOutputStream previously opened. -------------------------------------------------- Free Java/J2EE Database Connection Pooling Software http://www.primrose.org.uk
Dec 11, 2005 Thread starter #3 lipi123 Programmer May 1, 2005 2 US Hi, I have written the following code in catch block catch (Exception e) { OutputStream bos = new FileOutputStream("Log"); e.printStackTrace(bos); } I am getting the following error, when I execute the above code: dbUpload2.java:106: cannot find symbol symbol : method printStackTrace(java.iutputStream) location: class java.lang.Exception e.printStackTrace(bos); Upvote 0 Downvote
Hi, I have written the following code in catch block catch (Exception e) { OutputStream bos = new FileOutputStream("Log"); e.printStackTrace(bos); } I am getting the following error, when I execute the above code: dbUpload2.java:106: cannot find symbol symbol : method printStackTrace(java.iutputStream) location: class java.lang.Exception e.printStackTrace(bos);
Dec 11, 2005 #4 sedj Programmer Aug 6, 2002 5,610 Try this : catch (Exception e) { PrintWriter pw = new PrintWriter(new FileOutputStream("Log")); e.printStackTrace(pw); } -------------------------------------------------- Free Java/J2EE Database Connection Pooling Software http://www.primrose.org.uk Upvote 0 Downvote
Try this : catch (Exception e) { PrintWriter pw = new PrintWriter(new FileOutputStream("Log")); e.printStackTrace(pw); } -------------------------------------------------- Free Java/J2EE Database Connection Pooling Software http://www.primrose.org.uk
Dec 13, 2005 #5 shekinskiy Programmer Nov 14, 2005 11 TR hi an other way for logging can be using log4j, an open source project. i dont know direct download for project. but you can find download link from google, or http://jakarta.apache.org Upvote 0 Downvote
hi an other way for logging can be using log4j, an open source project. i dont know direct download for project. but you can find download link from google, or http://jakarta.apache.org