How can I make sure that this path:
new Zend_Log_Writer_Stream(APPLICATION_PATH . '\logs\app.log')
works both on linux and on windows?
In Linux, the path separator is /. In Windows, it is either \ or /. So just use forward slashes and you will be fine.
APPLICATION_PATH . '/logs/app.log'
You can also use DIRECTORY_SEPARATOR constant instead of \ or /.
Usually you'll want to re-define it to have shorter name, like
$filename = APP . DS . 'logs' . DS . 'file.txt';
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
5 years ago
2 years ago