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 Summary
ConstructorsConstructorDescriptionLoggingResource
(com.atlassian.sal.api.ApplicationProperties applicationProperties, LogCaptor logCaptor) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
clearLogFile
(String logFileName) void
disableLog
(String key) void
javax.ws.rs.core.Response
getLogFile
(String logFileName) getLoggingLevel
(String loggerName) boolean
logMessage
(String destination, String message) Log a message to the server's console.setLoggingLevel
(String loggerName, String level) Change the level of the specified logger.
-
Constructor Details
-
LoggingResource
@Inject public LoggingResource(com.atlassian.sal.api.ApplicationProperties applicationProperties, LogCaptor logCaptor)
-
-
Method Details
-
getLoggingLevel
-
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.LoggingResourcelevel
- 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 loggedmessage
- 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
-
enableLog
-
disableLog
-