예제 #1
0
        protected override void OnStart()
        {
            // Initialize periodic log delete service
            var logPeriodicDeleteService = Container.Resolve <ILogPeriodicDeleteService>();

            logPeriodicDeleteService.Init();

            LogFileService.Rotate();
        }
예제 #2
0
        protected override async void OnStart()
        {
            // Initialize periodic log delete service
            var logPeriodicDeleteService = Container.Resolve <ILogPeriodicDeleteService>();

            logPeriodicDeleteService.Init();

            LogFileService.Rotate();

            await EventLogRepository.RotateAsync(
                AppConstants.EventLogFileExpiredSeconds);
        }
예제 #3
0
        private void CreateZipFile()
        {
            LogId       = logFileService.CreateLogId();
            ZipFileName = logFileService.LogUploadingFileName(LogId);

            UserDialogs.Instance.ShowLoading(Resources.AppResources.Processing);

            _ = TaskRun(() =>
            {
                logFileService.Rotate();

                var result = logFileService.CreateLogUploadingFileToTmpPath(ZipFileName);

                BeginInvokeOnMainThread(async() =>
                {
                    UserDialogs.Instance.HideLoading();

                    if (!result)
                    {
                        // Failed to create ZIP file
                        await UserDialogs.Instance.AlertAsync(
                            Resources.AppResources.FailedMessageToGetOperatingInformation,
                            Resources.AppResources.Error,
                            Resources.AppResources.ButtonOk);

                        _ = await NavigationService.GoBackAsync();
                    }
                });
            });
        }
예제 #4
0
 public override void OnReceive(Context context, Intent intent)
 {
     try
     {
         loggerService.Info($"Action: {intent.Action}");
         logFileService.Rotate();
         loggerService.Info("Periodic deletion of old logs.");
         var nextScheduledTime = LogPeriodicDeleteServiceAndroid.SetNextSchedule();
         loggerService.Info($"Next scheduled time: {DateTimeOffset.FromUnixTimeMilliseconds(nextScheduledTime).ToOffset(new TimeSpan(9, 0, 0))}");
     }
     catch
     {
         // do nothing
     }
 }
예제 #5
0
        public override void Main()
        {
            base.Main();

            try
            {
                loggerService.StartMethod();

                logFileService.Rotate();

                loggerService.Info("Periodic deletion of old logs.");
                loggerService.EndMethod();
            }
            catch
            {
                // do nothing
            }
        }