Skip to content

Instantly share code, notes, and snippets.

@rwoloszyn
Created April 6, 2016 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwoloszyn/3b250e54df72441d5a8e76908bfc8478 to your computer and use it in GitHub Desktop.
Save rwoloszyn/3b250e54df72441d5a8e76908bfc8478 to your computer and use it in GitHub Desktop.
Read log files
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