protected override void OnStart() { // Initialize periodic log delete service var logPeriodicDeleteService = Container.Resolve <ILogPeriodicDeleteService>(); logPeriodicDeleteService.Init(); LogFileService.Rotate(); }
protected override async void OnStart() { // Initialize periodic log delete service var logPeriodicDeleteService = Container.Resolve <ILogPeriodicDeleteService>(); logPeriodicDeleteService.Init(); LogFileService.Rotate(); await EventLogRepository.RotateAsync( AppConstants.EventLogFileExpiredSeconds); }
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(); } }); }); }
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 } }
public override void Main() { base.Main(); try { loggerService.StartMethod(); logFileService.Rotate(); loggerService.Info("Periodic deletion of old logs."); loggerService.EndMethod(); } catch { // do nothing } }