Example #1
0
        private static void FilteredLog(IWebEventService logger, EnmEventLevel level, EnmEventType type, string ip, string url, string referrer, string message, string userId, Exception exception = null)
        {
            //don't log thread abort exception
            if (exception is System.Threading.ThreadAbortException)
            {
                return;
            }

            if (logger.IsEnabled(level))
            {
                try {
                    var log = new H_WebEvent {
                        Id           = Guid.NewGuid(),
                        Level        = level,
                        Type         = type,
                        ShortMessage = message,
                        FullMessage  = exception == null ? string.Empty : exception.ToString(),
                        IpAddress    = ip,
                        PageUrl      = url,
                        ReferrerUrl  = referrer,
                        UserId       = userId,
                        CreatedTime  = DateTime.Now
                    };

                    logger.Insert(log);
                } catch (Exception ex) {
                    Console.Write(ex.Message);
                }
            }
        }
Example #2
0
 public ProjectController(
     IExcelManager excelManager,
     ICacheManager cacheManager,
     IWorkContext workContext,
     IWebEventService webLogger,
     IReservationService reservationService,
     INodeInReservationService nodesInReservationService,
     IProjectService projectService,
     INoteService noteService,
     IUserService userService,
     IRoleService roleService,
     IEntitiesInRoleService entitiesInRoleService,
     IAreaService areaService,
     INoticeService noticeService,
     INoticeInUserService noticeInUserService)
 {
     this._excelManager              = excelManager;
     this._cacheManager              = cacheManager;
     this._workContext               = workContext;
     this._webLogger                 = webLogger;
     this._reservationService        = reservationService;
     this._nodesInReservationService = nodesInReservationService;
     this._projectService            = projectService;
     this._noteService               = noteService;
     this._userService               = userService;
     this._roleService               = roleService;
     this._entitiesInRoleService     = entitiesInRoleService;
     this._areaService               = areaService;
     this._noticeService             = noticeService;
     this._noticeInUserService       = noticeInUserService;
 }
Example #3
0
 public ConfigurationController(
     ICacheManager cacheManager,
     IWorkContext workContext,
     IWebEventService webLogger,
     IAAlarmService actAlmService)
 {
     this._cacheManager  = cacheManager;
     this._workContext   = workContext;
     this._webLogger     = webLogger;
     this._actAlmService = actAlmService;
 }
Example #4
0
        private static void FilteredLog(IWebEventService logger, EnmEventLevel level, EnmEventType type, string message, string userId, Exception exception = null)
        {
            //don't log thread abort exception
            if (exception is System.Threading.ThreadAbortException)
            {
                return;
            }

            if (logger.IsEnabled(level))
            {
                var webHelper = EngineContext.Current.Resolve <IWebHelper>();
                FilteredLog(logger, level, type, webHelper.GetCurrentIpAddress(), webHelper.GetThisPageUrl(true), webHelper.GetUrlReferrer(), message, userId, exception);
            }
        }
Example #5
0
 public FtpController(
     IExcelManager excelManager,
     ICacheManager cacheManager,
     IWorkContext workContext,
     IWebEventService webLogger,
     IFsuService fsuService,
     IFtpService ftpService)
 {
     this._excelManager = excelManager;
     this._cacheManager = cacheManager;
     this._workContext  = workContext;
     this._webLogger    = webLogger;
     this._fsuService   = fsuService;
     this._ftpService   = ftpService;
 }
Example #6
0
 public static void Fatal(this IWebEventService logger, EnmEventType type, string ip, string url, string referrer, string message, string userId, Exception exception = null)
 {
     FilteredLog(logger, EnmEventLevel.Fatal, type, ip, url, referrer, message, userId, exception);
 }
Example #7
0
 public static void Error(this IWebEventService logger, EnmEventType type, string message, string userId, Exception exception = null)
 {
     FilteredLog(logger, EnmEventLevel.Error, type, message, userId, exception);
 }