-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLogDir.cs
37 lines (30 loc) · 1.24 KB
/
LogDir.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Text;
namespace RustyLogic.RedDotNet
{
public class LogDir
{
public enum LogType { AsyncQueue, Common, CopyProject, Export, Import, Publishing, Serverjobs, UpdataDatabase, ApplicationImport };
public static void Delete(LogType logType, int daysToKeep)
{
string rqlStatement =
"<IODATA>" +
"<ADMINISTRATION>" +
"<LOGDIR action=\"delete\" days=\"" + daysToKeep + "\" guid=\"" + logType.ToString() + "\"/>" +
"</ADMINISTRATION>" +
"</IODATA>";
Session.Execute(rqlStatement, Session.Info.SessionKey);
}
internal static void DeletePublishingLogs(Project project, int daysToKeep)
{
string rqlStatement =
"<IODATA>" +
"<PROJECT guid=\"" + project.GuidString + "\">" +
"<EXPORTREPORT guid=\"" + LogType.Publishing.ToString() + "\" days=\"" + daysToKeep + "\" action=\"deleteall\"/>" +
"</PROJECT>" +
"</IODATA>";
Session.Execute(rqlStatement, Session.Info.SessionKey);
}
}
}