|
@@ -115,23 +115,21 @@ public class XxlJobFileAppender {
|
115
|
115
|
appendLog += "\r\n";
|
116
|
116
|
|
117
|
117
|
// append file content
|
|
118
|
+ FileOutputStream fos = null;
|
118
|
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
|
123
|
} catch (Exception e) {
|
134
|
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
|
}
|