| | |
| | |
|
| | | import java.io.File;
|
| | | import java.io.FileOutputStream;
|
| | | import java.io.IOException;
|
| | | import java.io.OutputStream;
|
| | | import java.io.PrintStream;
|
| | | import java.util.ArrayList;
|
| | |
| | | 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");
|
| | |
| | | } 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");
|
| | |
| | | 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");
|
| | |
| | | e.printStackTrace(ps);
|
| | | ps.flush();
|
| | | ps.close();
|
| | | } catch (Exception e1) {
|
| | |
|
| | | } finally {
|
| | | out.close();
|
| | | try {
|
| | | out.close();
|
| | | } catch (IOException e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|