Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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