Class LoggingResource

java.lang.Object
com.atlassian.confluence.functest.rest.admin.LoggingResource

@Consumes("application/json") @Produces("application/json") @Path("/admin/logging") public class LoggingResource extends Object
  • Constructor Details

    • LoggingResource

      @Inject public LoggingResource(com.atlassian.sal.api.ApplicationProperties applicationProperties, LogCaptor logCaptor)
  • Method Details

    • getLoggingLevel

      @GET @Path("/level/{loggerName}") public String getLoggingLevel(@PathParam("loggerName") String loggerName)
    • setLoggingLevel

      @POST @Path("/level/{loggerName}") public String setLoggingLevel(@PathParam("loggerName") String loggerName, String level)

      Change the level of the specified logger.

      The level parameter can be one of (case insensitive):

      • DEBUG
      • INFO
      • WARN
      • ERROR
      • FATAL
      Parameters:
      loggerName - the full name of the logger e.g. com.atlassian.confluence.functest.rest.LoggingResource
      level - the level to change the logger to
      Returns:
      the original level of the logger before changing.
      Throws:
      BadRequestException - if the incoming loggerName is omitted
    • logMessage

      @POST @Path("/log/{destination}") public boolean logMessage(@PathParam("destination") String destination, String message)
      Log a message to the server's console.

      Only administrators can log messages.

      The destination of the message has the following valid values:

      • info - message will be logged at INFO level
      • debug - message will be logged at DEBUG level
      • warn - message will be logged at WARN level
      • error - message will be logged at ERROR level
      • sout - message will be written via System.out.println
      • serr - message will be written via System.err.println
      Parameters:
      destination - The destination of the message to be logged
      message - The text message to be logged to the console
      Returns:
      boolean True if the message is logged (ie destination is a valid level)
    • clearLogFile

      @POST @Path("/logFile/{logFileName}") public javax.ws.rs.core.Response clearLogFile(@PathParam("logFileName") String logFileName) throws IOException
      Throws:
      IOException
    • getLogFile

      @GET @Path("/logFile/{logFileName}") public javax.ws.rs.core.Response getLogFile(@PathParam("logFileName") String logFileName) throws IOException
      Throws:
      IOException
    • getLog

      @GET @Path("/getLog/{key}") public List<String> getLog(@PathParam("key") String key)
    • enableLog

      @POST @Path("/enableLog/{key}") public void enableLog(@PathParam("key") String key)
    • disableLog

      @DELETE @Path("/disableLog/{key}") public void disableLog(@PathParam("key") String key)