コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: kyvkri/mgone
 void menu_Click(object sender, MainMenuItem e)
 {
     switch (e.Id) {
         case "Restart": WAFContext.Restart(); break;
         case "Reset": WAFContext.Reset(); break;
         case "ResetSession": {
                 var thisGuid = WAFContext.Session.SessionId;
                 foreach (var s in WAFContext.Engine.GetAllSessions()) {
                     if (s.SessionId != thisGuid && s.SessionId != WAFContext.Engine.SystemSession.SessionId) s.Dispose();
                 }
                 WAFContext.Session.Notify("Session are reset. ");
                 WAFContext.Session.QueUIAction(new UIActionRefreshPage(Guid.Empty));
             }
             break;
         case "PurgeCache": {
                 PurgeRules rules = new PurgeRules() {
                     MaxAge = TimeSpan.FromSeconds(5)
                 };
                 WAFRuntime.Engine.PurgeContentCache(rules);
                 WAFRuntime.Engine.PurgeQueryCache(rules);
             }
             break;
         case "ClearCache": WAFContext.Engine.ClearCache(); break;
         case "ClearIndexQue": WAFRuntime.Engine.Dao.ClearIndexQue(); break;
         case "GetIndexQueInfo": WAFContext.Session.Notify(DialogueIcon.Info, "Index que statistics", WAFRuntime.Engine.Dao.GetActionQueStatistics()); break;
         case "DeleteSearchIndex":
             try {
                 WAFRuntime.Engine.Dao.DeleteIndex();
                 WAFContext.Session.Notify(DialogueIcon.Info, "The search index was deleted", "Rebuild index to recreate it. ");
             } catch (Exception error) {
                 WAFContext.Session.Notify(error);
             }
             break;
         case "Setup":
             Session["WAF_AllowSystemSetup"] = true;
             Response.Write("<script type=\"text/javascript\">window.parent.parent.location=\"" + WAFContext.UrlFromRootToApp + WAFContext.UrlFromAppToSystemSetup + "\";</script>");
             Response.End();
             //Response.Redirect();
             break;
         case "FlushGC": GC.Collect(); break;
         default: break;
     }
 }
コード例 #2
0
            /// <summary>Standard constructor</summary>
            public FileRotationLoggingConfig(string name, string dirPath, LogGate logGate, int maxFilesInRing, int advanceAfterFileSize, int mesgQueueSize)
                : this()
            {
                this.name = name;
                this.dirPath = dirPath;
                this.logGate = logGate;
                this.mesgQueueSize = mesgQueueSize;
                this.nameUsesDateAndTime = true;
                this.includeFileAndLine = true;
                this.includeQpcTime = true;

                this.advanceRules = new AdvanceRules();
                this.purgeRules = new PurgeRules();

                purgeRules.dirNumFilesLimit = maxFilesInRing;
                advanceRules.fileSizeLimit = advanceAfterFileSize;
                advanceRules.fileAgeLimitInSec = 24.0 * 3600.0;		// 1 day

                excludeFileNamesSet = new List<string>();

                createDirectoryIfNeeded = true;
            }