|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Logging & Security - Logging and access control > MCP Commands - Logging & Security |
MiniRobot Language (MRL) - MCP Logging & Security Commands
MCP.GetRetentionTime
Retrieve Current Log Retention Period
Purpose
The MCP.GetRetentionTime command retrieves the current log file retention period. This is the number of days that log files are kept before being automatically deleted by the cleanup process.
Understanding the retention period helps manage disk space and ensures compliance with data retention policies.
Syntax
MCP.GetRetentionTime|$$RETURN_VAR
Parameters
$$RETURN_VAR - The variable that will receive the retention time in days (as a numeric value).
Return Value
Returns the retention period in days as a numeric value. Common values include:
7 - Keep logs for 1 week
30 - Keep logs for 1 month
90 - Keep logs for 3 months
0 - No automatic cleanup (retain indefinitely)
Examples
' Example 1: Get current retention time
MCP.GetRetentionTime|$$Days
PRT.Logs are retained for $$Days days
' Example 2: Check if retention needs adjustment
MCP.GetRetentionTime|$$Current
IVV.$$Current<30
MCP.SetRetentionTime|30
EIF.
Remarks
The retention time affects only log files created by the MCP server. Other files in the log directory are not affected by this setting.
Log cleanup typically occurs during server startup or at scheduled intervals. Setting retention to 0 disables automatic cleanup.
Error Conditions
The command will fail with a parameter error if:
• The return variable parameter is missing
• Too many parameters are provided
See also:
• MCP.SetRetentionTime - Set Retention Time
• MCP.SetLogToFile - Set File Logging
• MCP.SetLogLevel - Set Logging Level