Class LogsResource
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.juneau.rest.servlet.RestServlet
org.apache.juneau.rest.servlet.BasicRestServlet
org.apache.juneau.microservice.resources.LogsResource
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
,BasicUniversalConfig
,DefaultConfig
,DefaultHtmlConfig
,BasicRestOperations
REST resource for viewing and accessing log files.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.juneau.microservice.resources.LogsResource.RedirectToRoot
deleteFile
(String path) org.apache.juneau.microservice.resources.LogsResource.FileContents
downloadFile
(RestResponse res, String path) getFile
(RestRequest req, String path) void
void
viewFile
(RestResponse res, String path, boolean highlight, String start, String end, String thread, String[] loggers, String[] severity) viewParsedEntries
(RestRequest req, String path, String start, String end, String thread, String[] loggers, String[] severity) Methods inherited from class org.apache.juneau.rest.servlet.BasicRestServlet
error, getFavIcon, getHtdoc, getStats, getSwagger
Methods inherited from class org.apache.juneau.rest.servlet.RestServlet
destroy, doLog, getContext, getPath, getRequest, getResponse, init, log, log, service, setContext
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
LogsResource
public LogsResource()
-
-
Method Details
-
init
- Throws:
Exception
-
getFile
public LogsResource.FileResource getFile(RestRequest req, @Path("/*") String path) throws NotFound, Exception -
viewFile
public void viewFile(RestResponse res, @Path("/*") String path, @Query(name="highlight",schema=@Schema(d="Add severity color highlighting.")) boolean highlight, @Query(name="start",schema=@Schema(d="Start timestamp (ISO8601, full or partial).\nDon\'t print lines logged before the specified timestamp.\nUse any of the following formats: yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddThh, yyyy-MM-ddThh:mm, yyyy-MM-ddThh:mm:ss, yyyy-MM-ddThh:mm:ss.SSS")) String start, @Query(name="end",schema=@Schema(d="End timestamp (ISO8601, full or partial).\nDon\'t print lines logged after the specified timestamp.\nUse any of the following formats: yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddThh, yyyy-MM-ddThh:mm, yyyy-MM-ddThh:mm:ss, yyyy-MM-ddThh:mm:ss.SSS")) String end, @Query(name="thread",schema=@Schema(d="Thread name filter.\nOnly show log entries with the specified thread name.")) String thread, @Query(name="loggers",schema=@Schema(d="Logger filter (simple class name).\nOnly show log entries if they were produced by one of the specified loggers.")) String[] loggers, @Query(name="severity",schema=@Schema(d="Severity filter.\nOnly show log entries with the specified severity.")) String[] severity) throws NotFound, MethodNotAllowed, IOException - Throws:
NotFound
MethodNotAllowed
IOException
-
viewParsedEntries
public LogParser viewParsedEntries(RestRequest req, @Path("/*") String path, @Query(name="start",schema=@Schema(d="Start timestamp (ISO8601, full or partial).\nDon\'t print lines logged before the specified timestamp.\nUse any of the following formats: yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddThh, yyyy-MM-ddThh:mm, yyyy-MM-ddThh:mm:ss, yyyy-MM-ddThh:mm:ss.SSS")) String start, @Query(name="end",schema=@Schema(d="End timestamp (ISO8601, full or partial).\nDon\'t print lines logged after the specified timestamp.\nUse any of the following formats: yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddThh, yyyy-MM-ddThh:mm, yyyy-MM-ddThh:mm:ss, yyyy-MM-ddThh:mm:ss.SSS")) String end, @Query(name="thread",schema=@Schema(d="Thread name filter.\nOnly show log entries with the specified thread name.")) String thread, @Query(name="loggers",schema=@Schema(d="Logger filter (simple class name).\nOnly show log entries if they were produced by one of the specified loggers.")) String[] loggers, @Query(name="severity",schema=@Schema(d="Severity filter.\nOnly show log entries with the specified severity.")) String[] severity) throws NotFound, IOException - Throws:
NotFound
IOException
-
downloadFile
public org.apache.juneau.microservice.resources.LogsResource.FileContents downloadFile(RestResponse res, @Path("/*") String path) throws NotFound, MethodNotAllowed - Throws:
NotFound
MethodNotAllowed
-
deleteFile
public org.apache.juneau.microservice.resources.LogsResource.RedirectToRoot deleteFile(@Path("/*") String path) throws MethodNotAllowed - Throws:
MethodNotAllowed
-