How can I access tomcat log files from Java web application deployed on it? -
how can access tomcat log files java web application deployed on it? possible?
okay, possible. used like:
public static string readlogfile () { stringbuilder sb = new stringbuilder(); try(bufferedreader br = new bufferedreader(new filereader("/var/log/tomcat8/catalina.out"))) { string line = br.readline(); while (line != null) { sb.append(line); sb.append(system.lineseparator()); line = br.readline(); } } catch (ioexception e) { // exception handling } return sb.tostring(); }
Comments
Post a Comment