Here you can find the source of LogException(Exception ex)
public static void LogException(Exception ex)
//package com.java2s; // LICENSE: This file is distributed under the BSD license. import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class Main { public static void LogException(Exception ex) { PrintWriter out = null;/*from www .j a va 2 s .com*/ try { out = new PrintWriter(new BufferedWriter(new FileWriter( "log.txt", true))); ex.printStackTrace(out); } catch (IOException e) { } finally { if (out != null) { out.close(); } } } }