Changeset 2757
- Timestamp:
- 03/27/13 16:30:08 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/frontend/ViewLogPage.java
r2756 r2757 14 14 import org.apache.wicket.markup.html.link.Link; 15 15 import org.apache.wicket.model.Model; 16 import org.slf4j.LoggerFactory; 16 17 17 18 /** … … 21 22 */ 22 23 public class ViewLogPage extends SecureAdminWebPage { 24 25 private final static org.slf4j.Logger logger = LoggerFactory.getLogger(ViewLogPage.class); 23 26 24 27 public ViewLogPage(final PageParameters pageParameters) { … … 46 49 if (logFile != null) { 47 50 try { 48 final RandomAccessFile raLogFile = geFileTail(logFile, tailSize);51 RandomAccessFile raLogFile = null; 49 52 try { 53 raLogFile = geFileTail(logFile, tailSize); 50 54 final String content = getLogFileContent(raLogFile); 51 55 … … 54 58 55 59 add(new DownloadLink("logDownloadLink", logFile)); 60 } catch (IOException ioEx) { 61 add(new Label("logLabel", "Could not read from log file. See error message below.")); 62 add(new TextArea("logText", new Model(ioEx.getMessage()))); 63 throw (ioEx); 56 64 } finally { 57 raLogFile.close(); 65 if (raLogFile != null) { 66 raLogFile.close(); 67 } 58 68 } 59 69 } catch (IOException ioEx) { 60 add(new Label("logLabel", "Could not read from log file. See error message below.")); 61 add(new TextArea("logText", new Model(ioEx.getMessage()))); 70 logger.error("Error in reading log file", ioEx); 62 71 } 63 72 }
Note: See TracChangeset
for help on using the changeset viewer.