Salesforce

How to truncate an AppServer/Webspeed/Dataserver broker and server log online on Windows

« Go Back

Information

 
TitleHow to truncate an AppServer/Webspeed/Dataserver broker and server log online on Windows
URL Name000054546
Article Number000170675
EnvironmentProduct: OpenEdge
Version: 10.x, 11.x, 12.x
OS: Windows
Other: Unified brokers
Question/Problem Description
How to truncate an AppServer/WebSpeed/DataServer broker and server log online on Windows.
How to truncate a WSA/AIA log online on Windows.
How to truncate the dataserv.lg online on Windows?
 
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
It is possible to use the following MS-Powershell script to truncate the log file using the command:
 
powershell -ExecutionPolicy ByPass -File c:\tools\cut.ps1 <your log file location>

Where cut.ps1 is the PowerShell script below. 

Example:
 
powershell -ExecutionPolicy ByPass -File c:\tools\cut.ps1 asbroker1.server.log
 
#  POWERSHELL SCRIPT: cut.ps1

param( [string]$Srcfile )

If ( $Srcfile -eq "" ) {
Write-Host
Write-Host "Cut.ps1,  Version 1.01"
Write-Host "Cut content of a text file"
Write-Host
Write-Host "Usage:  .\cut.PS1  <File Path>\Srcfile"
Write-Host
Write-Host "Where:  Srcfile is the file to be cut"
Write-Host
}
Else {

     if(Test-Path "$Srcfile") {
       $newlines= "--- Cut ! ---" + [DateTime]::Now.ToString("yyyy-MM-dd@HH:mm:ss") 
       $newlines | out-file -Force -Encoding ASCII  $Srcfile
     } 
     Else {
       Write-Host "File " $Srcfile " does not exist"   
     }  
}



 
Workaround
Notes
Keyword Phrase
Last Modified Date1/11/2024 3:15 AM

Powered by