public static function getInstance() { if (empty(self::$instance)) { try { self::$instance = new phpLog(); } catch (Exception $e) { echo 'Log creation failed : ' . $e->getMessage(); } } return self::$instance; }