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 $format a regular date() string format */ public function setDatePattern($format) { $this->datePattern = $format; } /** * @return string returns date format for the filename */ public function getDatePattern() { return $this->datePattern; } /** * The File property takes a string value which should be the name of the file to append to. * Sets and opens the file where the log output will go. * * @see LoggerAppenderFile::setFile() */ public function setFile() { $numargs = func_num_args(); $args = func_get_args(); if($numargs == 1 and is_string($args[0])) { parent::setFile( sprintf((string)$args[0], date($this->getDatePattern())) ); } else if ($numargs == 2 and is_string($args[0]) and is_bool($args[1])) { parent::setFile( sprintf((string)$args[0], date($this->getDatePattern())), $args[1] ); } } }