<?php
/**
* Generates log configuration settings.
*
* This function creates a configuration array for logging,
* including limits on file size, number of files, and maximum
* log file age. These limits are hardcoded for this utility.
*
* @return array An associative array containing log configuration settings.
*/
function generateLogConfig(): array
{
// Define log file path. Change as needed.
$logFilePath = '/var/log/myutility.log';
// Define maximum log file size (in MB).
$maxLogFileSizeMB = 10;
// Define maximum number of log files to keep.
$maxLogFiles = 5;
// Define maximum age of log files (in days).
$maxLogFileAgeDays = 30;
// Create the log configuration array.
$logConfig = [
'logFilePath' => $logFilePath,
'maxFileSizeMB' => $maxLogFileSizeMB,
'maxLogFiles' => $maxLogFiles,
'maxLogFileAgeDays' => $maxLogFileAgeDays,
];
return $logConfig;
}
// Example usage:
// $config = generateLogConfig();
// print_r($config);
?>
Add your comment