Clean

Description

The clean operation deletes the log files for your deployment, freeing up disk space. The logs cannot be recovered once this operation is performed.

Request parameters

ParameterDetails

startTime

(Optional)

The start date associated with a log, in time stamp format (yyyy-mm-ddThh:mm:ss). If specified, logs created after this time will be deleted. When the endTime parameter is also defined, only logs created within the date range will be deleted. When logLevel is added to the request with a date range specified, only logs that match the selected level and were created within the defined date range will be deleted.

Use dark colors for code blocksCopy
1
startTime=2020-08-09-T22:45:03

endTime

(Optional)

The end date associated with a log, in time stamp format (yyyy-mm-ddThh:mm:ss). If specified, logs created before this time will be deleted. When the startTime parameter is also defined, only logs created within the date range will be deleted. When logLevel is added to the request with a date range specified, only logs that match the selected level and were created within the defined date range will be deleted.

Use dark colors for code blocksCopy
1
endTime=2020-08-09T22:45:06

logLevel

(Optional)

The level of the logs that will be deleted. If no option is selected, all log messages will be deleted.

Values: SEVERE | WARNING | INFO | FINE | VERBOSE | DEBUG

async

(Optional)

Introduced at 10.9.1. This parameter specifies whether the operation will run synchronously or asynchronously. If false, the operation is run synchronously. If true, the operation is run asynchronously and the response returns a JSON object containing job information that can be used to track the job's status. The default value is false.

Values: true | false

f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a sample POST request for the clean operation that demonstrates deleting DEBUG logs created within a specific date range:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /context/admin/logs/clean HTTP/1.1
Host: organization.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

startTime=2020-08-09-T22:45:03&endTime=2020-08-09T22:45:06logLevel=DEBUG&async=false&f=pjson&token=P4Vn2uao41gcVGxM8p3lwYgQnt9t20hRo8s4TDsH2XRtiF3xh-lNTfn1dIOaw3ke2P8nCQwjxeLV4kNiftyKCESSEPXiIbQGt9Ph7Bx_LQIGkIoXYZBNOWnOi7Fw8Z5GRg2_xYSWoLg8zzZcO3utdVsIG1Ew7Ab8f-Ti28TfUvtv7cWM9BzRaw00EtqbdJj0zu23kTYNsOO0KaXkJ5IR8wF1qGxD6-KmVyOdfC9ms51khCiq473WAo4Ho8zwkdwV

JSON Response examples

If async is false, the following response is returned once the logs are cleaned successfully:

Use dark colors for code blocksCopy
1
{"success": "true"}

If async is true, the following response is returned. The value returned for jobsUrl can be used to access the job resource to track a job's status after it's been submitted. For more information, see the Job resource topic.

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "jobsUrl": "https://organization.domain.com/context/admin/jobs/ja2ca1a35-881c-400c-a49a-b26883002d6c",
  "jobID": "ja2ca1a35-881c-400c-a49a-b26883002d6c",
  "jobStatus": "SUBMITTED"
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.