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; }
/// <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); }