admin
2019-07-30 573c491b4a1ba60e12a5678a01c1546c0077c1ee
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java
@@ -2,6 +2,7 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
@@ -92,7 +93,7 @@
      loginLogger.info(obj);
   }
   public static void errorDetailInfo(Throwable e) throws Exception {
   public static void errorDetailInfo(Throwable e) {
      e.printStackTrace();
      String date = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy_MM_dd");
      String os = System.getProperty("os.name");
@@ -102,20 +103,28 @@
      } else
         filePath = String.format("/usr/local/tomcat8/logs/error_detail_%s.txt", date);
      OutputStream out = new FileOutputStream(new File(filePath), true);
      OutputStream out = null;
      try {
         out = new FileOutputStream(new File(filePath), true);
         PrintStream ps = new PrintStream(out);
         ps.print(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
         ps.print("\n");
         e.printStackTrace(ps);
         ps.flush();
         ps.close();
      } catch (Exception ee) {
      } finally {
         out.close();
         try {
            out.close();
         } catch (IOException e1) {
            e1.printStackTrace();
         }
      }
   }
   public static void errorDetailInfo(Throwable e, String params, String url) throws Exception {
   public static void errorDetailInfo(Throwable e, String params, String url) {
      e.printStackTrace();
      String date = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy_MM_dd");
      String os = System.getProperty("os.name");
@@ -124,9 +133,9 @@
         filePath = String.format("C:/logs/error_detail_%s.txt", date);
      } else
         filePath = String.format("/usr/local/tomcat8/logs/error_detail_%s.txt", date);
      OutputStream out = new FileOutputStream(new File(filePath), true);
      OutputStream out = null;
      try {
         out = new FileOutputStream(new File(filePath), true);
         PrintStream ps = new PrintStream(out);
         ps.print(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
         ps.print("\n");
@@ -137,8 +146,14 @@
         e.printStackTrace(ps);
         ps.flush();
         ps.close();
      } catch (Exception e1) {
      } finally {
         out.close();
         try {
            out.close();
         } catch (IOException e1) {
            e1.printStackTrace();
         }
      }
   }