Skip to content

Feature: Create log directory if not present #592

Open
@rixafy

Description

@rixafy

Hi, would you be open to change the behavior of the Debugger and Logger, so when initialized, it will not fail when directory does not exist? I'm not sure what is better, to check and create directory every request (nette/bootstrap also checks existence of cache directory every request I think), or check and create directory before writing to file, because now it's checked every request but exception is thrown if directory is not present.

I think the more optimized solution would be check directory before writing to the logs, because if you will have permission to create or write to a file, you will also have permission to create a directory for that file.

This way, projects do not need to keep .gitignore in var/log directory, because usually the var directory is empty and components will create directories (doctrine/orm or symfony/lock) and there will be one less thing to care about while creating deployment process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions