Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Logger path property ignored #2725

Closed
dafriend opened this issue Mar 19, 2020 · 1 comment · Fixed by #2726
Closed

Bug: Logger path property ignored #2725

dafriend opened this issue Mar 19, 2020 · 1 comment · Fixed by #2726
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@dafriend
Copy link
Contributor

CI V 4.0.2 on develop at commit 84b9cc

Affected module(s)
CodeIgniter\Log\Logger

Expected behavior, and steps to reproduce if appropriate
Config\Logger::path setting is not used as the value for where to save log files.

Reproduce by setting some folder other than the default in Config\Logger::path e.g.

public $path = WRITEPATH . 'uploads/';

Then log something somewhere, e.g.

<?php namespace App\Controllers;

class Home extends BaseController
{
    public function index()
    {
	$this->logger->emergency("This will not be written to a file in the WRITEPATH/uploads folder");
	return view('welcome_message');
    }
}

File will be written to WRITEPATH/logs instead of WRITEPATH/luploads.

Context

  • Linux Debian 10
  • Apache/2.4.38 (Debian)
  • PHP version 7.3.14
@dafriend dafriend added the bug Verified issues on the current code behavior or pull requests that will fix them label Mar 19, 2020
samsonasik added a commit to samsonasik/CodeIgniter4 that referenced this issue Mar 20, 2020
samsonasik added a commit to samsonasik/CodeIgniter4 that referenced this issue Mar 20, 2020
samsonasik added a commit to samsonasik/CodeIgniter4 that referenced this issue Mar 20, 2020
@samsonasik
Copy link
Member

@dafriend I've created PR #2726 for it. Move the read config "path" read to under Logger::handlers['CodeIgniter\Log\Handlers\FileHandler'] with not isset and empty string check.

lonnieezell added a commit that referenced this issue Mar 22, 2020
Fixes #2725 : move logging directory path config to CodeIgniter\Log\Handlers\FileHandler config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
2 participants