Created
April 6, 2016 13:53
-
-
Save rwoloszyn/3b250e54df72441d5a8e76908bfc8478 to your computer and use it in GitHub Desktop.
Read log files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void readLogs() { | |
logger.debug("Enter"); | |
BufferedReader logReader = null; | |
try { | |
String line = null; | |
File log = getLogFile(); | |
logReader = new BufferedReader(new FileReader(log)); | |
while ((line = logReader.readLine()) != null) { | |
errorMsgTextView.setText(line); | |
} | |
} catch (FileNotFoundException e) { | |
logger.error("msg={}", e.getMessage()); | |
} catch (IOException e) { | |
logger.error("msg={}", e.getMessage()); | |
} finally { | |
IOUtils.closeQuietly(logReader); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment