should always be set before {@link $file} param. * @var string */ public $datePattern = "Ymd"; public function __destruct() { parent::__destruct(); } /** * Sets date format for the file name. * @param string $datePattern a regular date() string format */ public function setDatePattern($datePattern) { $this->datePattern = $datePattern; } /** * @return string returns date format for the filename */ public function getDatePattern() { return $this->datePattern; } /** * Similar to the parent method, but replaces "%s" in the file name with * the current date in format specified by $datePattern. * * @see LoggerAppenderFile::setFile() */ public function setFile($file) { $date = date($this->getDatePattern()); $file = sprintf($file, $date); parent::setFile(sprintf($file, $date)); } }