public User GetUser(string firstName) { try { Log.Information("File Name: " + _stackFrame.GetMethod().DeclaringType.Name + ".cs " + "NameSpace: " + _stackFrame.GetMethod().DeclaringType.Namespace + " Method Name: GetUser() "); User user = new User(); if (firstName != "") { user = _userRepository.GetUser(firstName); } Log.Information("File Name: " + _stackFrame.GetMethod().DeclaringType.Name + ".cs " + "GetUser() Method Executed Successfully"); return(user); } catch (Exception ex) { Log.Error("Error Message: " + ex.Message + " " + ex.StackTrace); throw; } }