xuxueli 7 lat temu
rodzic
commit
df613f163c

+ 12 - 14
xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java Wyświetl plik

115
 		appendLog += "\r\n";
115
 		appendLog += "\r\n";
116
 		
116
 		
117
 		// append file content
117
 		// append file content
118
+		FileOutputStream fos = null;
118
 		try {
119
 		try {
119
-			FileOutputStream fos = null;
120
-			try {
121
-				fos = new FileOutputStream(logFile, true);
122
-				fos.write(appendLog.getBytes("utf-8"));
123
-				fos.flush();
124
-			} finally {
125
-				if (fos != null) {
126
-					try {
127
-						fos.close();
128
-					} catch (IOException e) {
129
-						logger.error(e.getMessage(), e);
130
-					}
131
-				}
132
-			} 
120
+			fos = new FileOutputStream(logFile, true);
121
+			fos.write(appendLog.getBytes("utf-8"));
122
+			fos.flush();
133
 		} catch (Exception e) {
123
 		} catch (Exception e) {
134
 			logger.error(e.getMessage(), e);
124
 			logger.error(e.getMessage(), e);
125
+		} finally {
126
+			if (fos != null) {
127
+				try {
128
+					fos.close();
129
+				} catch (IOException e) {
130
+					logger.error(e.getMessage(), e);
131
+				}
132
+			}
135
 		}
133
 		}
136
 		
134
 		
137
 	}
135
 	}