katzgrau / KLogger

A Simple Logging Class For PHP
http://codefury.net/projects/klogger/
981 stars 284 forks source link

Failed to open stream: File Exists? #92

Open MGParisi opened 6 years ago

MGParisi commented 6 years ago

Warning: fopen(C:\wamp64\www\xxxx\wp-temp\xxxx\logs\log_2018-05-14.txt): failed to open stream: File exists in C:\wamp64\www\xxxx\wp-content\plugins\xxxx\vendor\katzgrau\klogger\src\Logger.php on line 167

This is run through the earlier class and is attempting to open with an 'a' attribute.

MGParisi commented 6 years ago
37 7.9236 78582472 project\system\notify->__construct( ) ...\base.php:37
38 7.9236 78583560 Katzgrau\KLogger\Logger->__construct( ) ...\notify.php:68
39 7.9238 78583656 Katzgrau\KLogger\Logger->setFileHandle( ) ...\Logger.php:130
40 7.9238 78583656 fopen ( ) ...\Logger.php:167

Sorry, can not provide access.. I can say this is on a Windows platform and that I created the directory with

    if (!is_dir($log_dir)) {
        $oldmask = umask(0);
        mkdir($log_dir,0777, true);
        umask($oldmask);
        chmod($log_dir, 0777);
    }

Also the log is in a parent directory.