Ejemplo n.º 1
0
        private static void RegisterRollbar()
        {
            Console.WriteLine("Note that Rollbar API is enabled by default to collect crashes. If you want to opt out, please run with -s switch");
            Rollbar.Init(new RollbarConfig
            {
                AccessToken = "1dd3cf880c5a46eeb4338dbea73f9620",
                Environment = "production"
            });
            var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            Rollbar.PersonData(() => new Person(version)
            {
                UserName = $"{version}"
            });
            Application.ThreadException += (sender, args) =>
            {
                Rollbar.Report(args.Exception);
            };

            AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
            {
                Rollbar.Report(args.ExceptionObject as System.Exception);
            };

            TaskScheduler.UnobservedTaskException += (sender, args) =>
            {
                Rollbar.Report(args.Exception);
            };
        }
Ejemplo n.º 2
0
        private static void SetupRollbar()
        {
            Rollbar.Init(new RollbarConfig
            {
                AccessToken = "5525758f15504199b7125d35d2058cfe",
                Environment = "production"
            });
            var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            Rollbar.PersonData(() => new Person(version)
            {
                UserName = $"{version} on {GetWindowsVersion()} with {Get45PlusFromRegistry()}"
            });
            Rollbar.Report($"Jexus Manager started", ErrorLevel.Info);

            Application.ThreadException += (sender, args) =>
            {
                Rollbar.Report(args.Exception);
            };

            AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
            {
                Rollbar.Report(args.ExceptionObject as Exception);
            };

            TaskScheduler.UnobservedTaskException += (sender, args) =>
            {
                Rollbar.Report(args.Exception);
            };
        }