Skip to content

Feature: Create log directory if not present #592

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

Open
rixafy opened this issue Jan 18, 2025 · 0 comments
Open

Feature: Create log directory if not present #592

rixafy opened this issue Jan 18, 2025 · 0 comments

Comments

@rixafy
Copy link

rixafy commented Jan 18, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant