Skip to content
Snippets Groups Projects
Commit e9040dc6 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Fix LoggerFactory to handle a Windows path with drive letter properly.

parent 5d82b1a6
Branches
Tags instance/fid_bbi/staging/20201203
No related merge requests found
......@@ -116,9 +116,16 @@ class LoggerFactory implements \Zend\ServiceManager\FactoryInterface
*/
protected function addFileWriters(Logger $logger, $config)
{
$parts = explode(':', $config);
$file = $parts[0];
$error_types = isset($parts[1]) ? $parts[1] : '';
// Make sure to use only the last ':' after second character to avoid trouble
// with Windows drive letters (e.g. "c:\something\logfile:error-5")
$pos = strrpos($config, ':', 2);
if ($pos > 0) {
$file = substr($config, 0, $pos);
$error_types = substr($config, $pos + 1);
} else {
$file = $config;
$error_types = '';
}
// Make Writers
$filters = explode(',', $error_types);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment