Phalcon Logger throws 'Log directory does not exist' when target directory missing
29.5K reputation · 20 Dec 2021, 19:22 UTC
Phalcon Logger throws 'Log directory does not exist' when target directory missing
The goal is to configure the Phalcon Logger component so that logging continues reliably even when the configured log directory is absent or unwritable, while still emitting only meaningful alerts and avoiding unnecessary notification noise.
Constraints include preserving the existing log level routing (e.g., Stream for errors, File for info), not masking genuine configuration problems, and ensuring that any automatic directory creation does not introduce security risks or permission conflicts in shared hosting environments.
- Should the application automatically create the missing log directory with appropriate permissions, or is it better to fall back to an alternative adapter such as Syslog or a null adapter?
- How can we distinguish a transient missing‑directory condition from a permanent misconfiguration so that only genuine issues trigger alert notifications?
- What level‑based filtering strategy prevents duplicate notifications when multiple adapters are active and the directory error is caught and handled?