public ActivationDiagnostics() { Timer = new PerfTimer(); _log = new LoggingSession(Timer); }
public async void InitiateLogger() { LogChannel = new LoggingChannel("OctoCentralChannel"); LogSession = new LoggingSession("OctoCentral Session"); LogSession.AddLoggingChannel(LogChannel); await RegisterUnhandledErrorHandler(); }
public async void InitiateLogger() { logChannel = new LoggingChannel("MySampleChannel"); logSession = new LoggingSession("MySample Session"); logSession.AddLoggingChannel(logChannel); await RegisterUnhandledErrorHandler(); }
public async void InitiateLogger() { LogChannel = new LoggingChannel("OctoCentralChannel"); LogSession = new LoggingSession("OctoCentral Session"); LogSession.AddLoggingChannel(LogChannel); await RegisterUnhandledErrorHandler(); }
public async Task InitiateLogger() { LoggingSession.AddLoggingChannel(_loggingChannel); LoggingFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("LogFiles", CreationCollisionOption.OpenIfExists); CoreApplication.UnhandledErrorDetected += CoreApplication_UnhandledErrorDetected; BootStrapper.Current.UnhandledException += CurrentOnUnhandledException; BootStrapper.Current.Suspending += CurrentOnSuspending; }
private Logger() { session = new LoggingSession("AllJoynVoiceSession"); channel = new LoggingChannel("AllJoynVoiceChannel", null); session.AddLoggingChannel(channel); Windows.UI.Xaml.Application.Current.UnhandledException += Current_UnhandledException; }
static LoggingService() { _LcDebug = new LoggingChannel( "QuickbirdUWP_Log", new LoggingChannelOptions(new Guid("d3020f82-b5bd-4ead-b739-a2e043d075f3")) ); _Session = new LoggingSession("AppWideSession"); _Session.AddLoggingChannel(_LcDebug); }
public LoggingService() { logChannel = new LoggingChannel(LOG_CHANNEL_RESROUCE_NAME, new LoggingChannelOptions()); logSession = new LoggingSession(LOG_SESSION_RESROUCE_NAME); logSession.AddLoggingChannel(logChannel); semaphoreLock = new SemaphoreSlim(1); CoreApplication.UnhandledErrorDetected += OnUnhandledErrorDetected; PrismUnityApplication.Current.UnhandledException += OnUnhandledException; }
// Constructor public MainPage() { InitializeComponent(); this.sts = StsFactory.CreateSts(StsType.AAD); this.fls = new FileLoggingSession("Test File Logging Session"); this.fls.AddLoggingChannel(AdalTrace.AdalLoggingChannel, LoggingLevel.Verbose); this.ls = new LoggingSession("Test Logging Session"); this.ls.AddLoggingChannel(AdalTrace.AdalLoggingChannel, LoggingLevel.Verbose); }
// Constructor public MainPage() { InitializeComponent(); this.sts = StsFactory.CreateSts(StsType.AAD); this.fls = new FileLoggingSession("Test File Logging Session"); this.fls.AddLoggingChannel(AdalTrace.AdalLoggingChannel, LoggingLevel.Verbose); this.ls = new LoggingSession("Test Logging Session"); this.ls.AddLoggingChannel(AdalTrace.AdalLoggingChannel, LoggingLevel.Verbose); }
private StorageFile SaveFile() { if (LoggingSession == null) { return(null); } var task = LoggingSession .SaveToFileAsync(LoggingFolder, $"{DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss-tt")}.{BaseName}.etl") .AsTask(); task.Wait(); return(task.Result); }
/// <summary> /// Starts a new trace. /// </summary> /// <exception cref="ObjectDisposedException"></exception> /// <exception cref="InvalidOperationException">A trace is currently ongoing.</exception> public void StartTrace() { if (this.disposed) { throw new ObjectDisposedException("this"); } if (this.traceSession != null) { throw new InvalidOperationException("Already tracing"); } this.traceSession = new LoggingSession("etwTrace"); this.traceSession.AddLoggingChannel(this.logger); }
/// <summary> /// Ends a trace without saving. /// </summary> /// <exception cref="ObjectDisposedException"></exception> /// <exception cref="InvalidOperationException">No trace is active.</exception> public void CancelTrace() { if (this.disposed) { throw new ObjectDisposedException("this"); } if (this.traceSession == null) { throw new InvalidOperationException("No trace is in progress"); } this.traceSession.RemoveLoggingChannel(this.logger); this.traceSession.Dispose(); this.traceSession = null; }
protected virtual void Dispose(bool disposing) { if (isDisposed == false) { isDisposed = true; if (disposing) { if (channel != null) { channel.Dispose(); channel = null; } if (session != null) { session.Dispose(); session = null; } } } }
public void StartLogging() { CheckDisposed(); // If no session exists, create one. // NOTE: There are use cases where an application // may want to create only a channel for sessions outside // of the application itself. See MSDN for details. This // sample is the common scenario of an app logging events // which it wants to place in its own log file, so it creates // a session and channel as a pair. The channel is created // during construction of this LoggingSessionScenario class so // it already exsits by the time this function is called. if (session == null) { session = new LoggingSession(DEFAULT_SESSION_NAME); } // This sample adds the channel at level "warning" to // demonstrated how messages logged at more verbose levels // are ignored by the session. session.AddLoggingChannel(channel, LoggingLevel.Warning); }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override async void OnLaunched(LaunchActivatedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; if (appListener == null) { appListener = new LogEventListener(); appListener.EnableEvents(LogEventSource.Log, EventLevel.Verbose); errorListener = new LogEventListener("Errors"); errorListener.EnableEvents(LogEventSource.Log, EventLevel.Error); LogEventSource.Log.Info("App initialized."); // winRT approach channel = new LoggingChannel("WinRTChannel"); channel.LoggingEnabled += (o, args) => { this.winRtLoggingEnabled = o.Enabled; this.winRtLogLevel = o.Level; }; session = new LoggingSession("WinRTSession"); session.AddLoggingChannel(channel); } // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); //Associate the frame with a SuspensionManager key SuspensionManager.RegisterFrame(rootFrame, "AppFrame"); // Set the default language rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { // Restore the saved session state only when appropriate try { const string Message = "Restoring saved session state."; LogEventSource.Log.Info(Message); channel.LogMessage(Message, LoggingLevel.Information); await SuspensionManager.RestoreAsync(); } catch (SuspensionManagerException ex) { var message = string.Format("Error restoring saved session state: {0}", ex.Message); LogEventSource.Log.Error(message); channel.LogMessage(message, LoggingLevel.Error); //Something went wrong restoring state. //Assume there is no state and continue } } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(HubPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); const string Msg = "Window activated."; LogEventSource.Log.Info(Msg); channel.LogMessage(Msg, LoggingLevel.Information); }
public EtwLogService(string sessionName, Guid guid) { _session = new LoggingSession(sessionName); _channel = new LoggingChannel(sessionName + "_Channel", null, guid); _session.AddLoggingChannel(_channel); }
public void StartLogging() { CheckDisposed(); // If no session exists, create one. // NOTE: There are use cases where an application // may want to create only a channel for sessions outside // of the application itself. See MSDN for details. This // sample is the common scenario of an app logging events // which it wants to place in its own log file, so it creates // a session and channel as a pair. The channel is created // during construction of this LoggingSessionScenario class so // it already exsits by the time this function is called. if (session == null) { session = new LoggingSession(DEFAULT_SESSION_NAME); } // This sample adds the channel at level "warning" to // demonstrated how messages logged at more verbose levels // are ignored by the session. session.AddLoggingChannel(channel, LoggingLevel.Warning); }
protected virtual void Dispose(bool disposing) { if (isDisposed == false) { isDisposed = true; if (disposing) { if (channel != null) { channel.Dispose(); channel = null; } if (session != null) { session.Dispose(); session = null; } } } }