How to check since when AEM author/publisher instance is running?
I am new to AEM development.
I have use-case to check since how long AEM author/publish instance is up and running. Can you suggest how can I achieve this through Java/jsp?
Thanks,
I am new to AEM development.
I have use-case to check since how long AEM author/publish instance is up and running. Can you suggest how can I achieve this through Java/jsp?
Thanks,
I am not sure if there is a function to get the directory. However, you can access the logs by just using the "crx-quickstart" when using the file path. For example:
InputStream in = new FileInputStream(new File("crx-quickstart/logs/stdout.log"));Here is an example component you could use to display the log file:
<%@include file="/libs/foundation/global.jsp"%> <%@page session="false" %> <%@ page import="java.util.*, java.io.*"%> <body> <% InputStream in = new FileInputStream(new File("crx-quickstart/logs/stdout.log")); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder out2 = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { out.append(line); } System.out.println(out2.toString()); //Prints the string content read from input stream reader.close(); %> </body>If you make a component with this code, and add it to a page, it should output the file. It will be one big block of text, but the example should work.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.