public function createForService($serviceName) {
		if ($this->_basePath === null) {
			throw new ConfigError('Base path was not given');
		}
		
		$filename = $this->_filenameTemplate;
		
		if (strpos($filename, self::PATTERN_SERVICE) !== false) {
			$filename = str_replace(self::PATTERN_SERVICE, $serviceName, $filename);
		}
		
		if (strpos($filename, self::PATTERN_DATE) !== false) {
			$filename = str_replace(self::PATTERN_DATE, date($this->_dateFormat), $filename);
		}
		
		$path = $this->_basePath;
		
		if ($this->_separateDirs) {
			$path .= DIRECTORY_SEPARATOR . $serviceName;
			
			if ((! file_exists($path) || ! is_dir($path)) && ! mkdir($path)) {
				throw new NoDirectory('Directory does not exists and unable to create: "' . $path . '"');
			}
		}
		
		$path .= DIRECTORY_SEPARATOR . $filename;
		
		if (isset($this->_loggers[$serviceName])) {
			return $this->_loggers[$serviceName];
		}
		
		$adapter = $this->getCreateCallback()->__invoke($path);
		$logger  = new Logger($adapter);
		
		$this->_loggers[$serviceName] = $logger;
		return $logger;
	}
public function createForService($serviceName) {
		if ($this->_basePath === null) {
			throw new ConfigError('Base path was not given');
		}
		
		$filename = $this->_filenameTemplate;
		
		if (strpos($filename, self::PATTERN_SERVICE) !== false) {
			$filename = str_replace(self::PATTERN_SERVICE, $serviceName, $filename);
		}
		
		if (strpos($filename, self::PATTERN_DATE) !== false) {
			$filename = str_replace(self::PATTERN_DATE, date($this->_dateFormat), $filename);
		}
		
		$path = $this->_basePath;
		
		if ($this->_separateDirs) {
			$path .= DIRECTORY_SEPARATOR . $serviceName;
			
			if ((! file_exists($path) || ! is_dir($path)) && ! mkdir($path)) {
				throw new NoDirectory('Directory does not exists and unable to create: "' . $path . '"');
			}
		}
		
		$path .= DIRECTORY_SEPARATOR . $filename;
		
		if (isset($this->_loggers[$serviceName])) {
			return $this->_loggers[$serviceName];
		}
		
		$adapter = $this->getCreateCallback()->__invoke($path);
		$logger  = new Logger($adapter);
		
		$this->_loggers[$serviceName] = $logger;
		return $logger;
	}
public function createForService ( $ serviceName ) { if ( $ this -> _basePath === null ) { throw new ConfigError ( 'Base path was not given' ) ; } $ filename = $ this -> _filenameTemplate ; if ( strpos ( $ filename , self :: PATTERN_SERVICE ) !== false ) { $ filename = str_replace ( self :: PATTERN_SERVICE , $ serviceName , $ filename ) ; } if ( strpos ( $ filename , self :: PATTERN_DATE ) !== false ) { $ filename = str_replace ( self :: PATTERN_DATE , date ( $ this -> _dateFormat ) , $ filename ) ; } $ path = $ this -> _basePath ; if ( $ this -> _separateDirs ) { $ path .= DIRECTORY_SEPARATOR . $ serviceName ; if ( ( ! file_exists ( $ path ) || ! is_dir ( $ path ) ) && ! mkdir ( $ path ) ) { throw new NoDirectory ( 'Directory does not exists and unable to create: "' . $ path . '"' ) ; } } $ path .= DIRECTORY_SEPARATOR . $ filename ; if ( isset ( $ this -> _loggers [ $ serviceName ] ) ) { return $ this -> _loggers [ $ serviceName ] ; } $ adapter = $ this -> getCreateCallback ( ) -> __invoke ( $ path ) ; $ logger = new Logger ( $ adapter ) ; $ this -> _loggers [ $ serviceName ] = $ logger ; return $ logger ; }
Create a logger for the service

@param  string $serviceName
@return LoggerInterface
@throws ConfigError
@throws NoDirectory
Create a logger for the service