|
|
Job Component |
ClearLogFile method |
|
ClearLogFile(NumberOfLinesToKeep As Long) |
Returns: None |
|
The ClearLogFile method allows you to maintain your jobs log file size. It will clear the earliest log entries first, keeping the number of log entries specified in the NumberOfLinesToKeep parameter.
Example:
[Visual Basic .NET]
|
Public Sub RunMyJob() |
|
Dim js As ExportBudget.CRJobStatus |
|
Dim myExportBudgetJob As ExportBudget |
|
|
|
myExportBudgetJob = New ExportBudget() |
|
myExportBudgetJob.JobPaths.JobStatusFileName = "ExportJobStatus.xml" |
|
myExportBudgetJob.RunJob() |
|
|
|
js = myExportBudgetJob.GetJobStatus() |
|
|
|
If Not (js Is Nothing) Then |
|
MsgBox("Job is done, Status: " + js.JobStatus.ToString) |
|
Else |
|
MsgBox("Job is done") |
|
End If |
|
|
|
myExportBudgetJob.ClearLogFile(100) ' Keep the last 100 log entries |
|
|
|
End Sub |
|
|
[C#]
|
private void RunMyJob() |
|
{ |
|
ExportBudget.CRJobStatus js; |
|
ExportBudget myExportBudgetJob; |
|
|
|
myExportBudgetJob = new ExportBudget(); |
|
myExportBudgetJob.JobPaths.JobStatusFileName = "ExportJobStatus.xml"; |
|
myExportBudgetJob.RunJob(); |
|
|
|
js = myExportBudgetJob.GetJobStatus(); |
|
|
|
if (js != null) |
|
{ |
|
MessageBox.Show("Job is done, Status: " + js.JobStatus.ToString()); |
|
} |
|
else |
|
{ |
|
MessageBox.Show("Job is done"); |
|
} |
|
|
|
myExportBudgetJob.ClearLogFile(100); ' Keep the last 100 log entries |
|
|
|
} |
|
|
© 2003 - 2007 Relational Solutions, Inc. - All rights reserved