admin
2021-01-25 2ba431be9c12a79783e0f9ef249292b7fa95f2a1
fanli/src/main/java/com/yeshi/fanli/log/PushLogHelper.java
@@ -8,7 +8,7 @@
import org.apache.log4j.Logger;
import com.yeshi.fanli.util.TimeUtil;
import org.yeshi.utils.TimeUtil;
/**
 * 推送日志
@@ -77,6 +77,36 @@
      } catch (IOException e1) {
      }
   }
   public static void oppoError(Throwable e) {
      String date = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy_MM_dd");
      String os = System.getProperty("os.name");
      String filePath = String.format("/usr/local/tomcat8/logs/push/oppo_error_detail_%s.txt", date);
      if (os.toLowerCase().startsWith("win")) {
         filePath = String.format("C:/logs/push/oppo_error_detail_%s.txt", date);
      }
      try {
         saveErrorLog(e, filePath);
      } catch (IOException e1) {
      }
   }
   public static void vivoError(Throwable e) {
      String date = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy_MM_dd");
      String os = System.getProperty("os.name");
      String filePath = String.format("/usr/local/tomcat8/logs/push/vivo_error_detail_%s.txt", date);
      if (os.toLowerCase().startsWith("win")) {
         filePath = String.format("C:/logs/push/vivo_error_detail_%s.txt", date);
      }
      try {
         saveErrorLog(e, filePath);
      } catch (IOException e1) {
      }
   }
   public static void saveErrorLog(Throwable e, String filePath) throws IOException {
      // 创建文件夹