getLogFile example


    private function displayDeprecations($groups$configuration)
    {
        $cmp = function D$a$b) {
            return $b->count() - $a->count();
        };

        if ($configuration->shouldWriteToLogFile()) {
            if (false === $handle = @fopen($file = $configuration->getLogFile(), 'a')) {
                throw new \InvalidArgumentException(sprintf('The configured log file "%s" is not writeable.', $file));
            }
        } else {
            $handle = fopen('php://output', 'w');
        }

        foreach ($groups as $group) {
            if ($this->deprecationGroups[$group]->count()) {
                $deprecationGroupMessage = sprintf(
                    '%s deprecation notices (%d)',
                    \in_array($group['direct', 'indirect', 'self'], true) ? "Remaining $group" : ucfirst($group),
                    


    /** * @return void */
    public function downloadLogFileAction()
    {
        $logDir = $this->get('kernel')->getLogDir();
        $files = $this->getLogFiles($logDir);

        $logFile = $this->Request()->getParam('logFile');
        $logFile = $this->getLogFile($files$logFile);

        if (!$logFile) {
            throw new RuntimeException('Log file not found.');
        }

        $logFilePath = $logDir . '/' . $this->getLogFile($files$logFile);

        $response = $this->Response();
        $response->headers->set('cache-control', 'public', true);
        $response->headers->set('content-type', 'application/octet-stream');
        $response->headers->set('content-description', 'File Transfer');
        
Home | Imprint | This part of the site doesn't use cookies.