public void ErrorLogging(Exception e) { string projectId = "jurgen-cloud-project"; string serviceName = "PFTCAssignment"; string version = "1"; var exceptionError = GoogleExceptionLogger.Create(projectId, serviceName, version); exceptionError.Log(e); }
//Error logging public void LogError(Exception message) { string projectId = "pfc-home"; string serviceName = "pfc-home-app"; string version = "4.0.0"; var exceptionLogger = GoogleExceptionLogger.Create(projectId, serviceName, version); exceptionLogger.Log(message); }
public void LogError(Exception e) { //for beta versions you have check a small checkbox called include pre-release string projectId = "programmingforthecloudbf"; //your project id string serviceName = "BFError"; //your application name (which you can invent) string version = "1"; //any version which you're working on at the moment (which you can invent) var exceptionLogger = GoogleExceptionLogger.Create(projectId, serviceName, version); exceptionLogger.Log(e); }
public string ThrowCatchWithGoogleLogger(string id) { var exceptionLogger = GoogleExceptionLogger.Create(TestEnvironment.GetTestProjectId(), EntryData.Service, EntryData.Version); var message = EntryData.GetMessage(nameof(ThrowCatchWithGoogleLogger), id); try { throw new Exception(message); } catch (Exception e) { exceptionLogger.Log(e); } return(message); }
public string ThrowCatchWithGoogleLogger(string id) { var exceptionLogger = GoogleExceptionLogger.Create(ProjectId, Service, Version); var message = GetMessage(nameof(ThrowCatchWithGoogleLogger), id); try { throw new Exception(message); } catch (Exception e) { exceptionLogger.Log(e); } return(message); }
// End sample public void ReadFile() { // Sample: LogExceptionsMVC string projectId = "[Google Cloud Platform project ID]"; string serviceName = "[Name of service]"; string version = "[Version of service]"; var exceptionLogger = GoogleExceptionLogger.Create(projectId, serviceName, version); try { string scores = File.ReadAllText(@"C:\Scores.txt"); Console.WriteLine(scores); } catch (IOException e) { exceptionLogger.Log(e); } // End sample }
public ErrorReportingController() { _exceptionLogger = GoogleExceptionLogger.Create(ProjectId, Service, Version); }
public static void ReportError(Exception ex) { var myLogger = GoogleExceptionLogger.Create("programming-for-the-cloud", "pftcLog", "1"); myLogger.Log(ex); }