Salesforce

Can the admserv.log file be truncated while the AdminServer is online?

« Go Back

Information

 
TitleCan the admserv.log file be truncated while the AdminServer is online?
URL Name000054009
Article Number000184927
EnvironmentProduct: OpenEdge
Version: All supported versions
OS: All supported platforms
Other: AdminServer
Question/Problem Description
Can the AdminServer log file be truncated while the AdminServer is online?
How to truncate admserv.log while the AdminServer is online?
Managing the admserv.log size without bringing the AdminServer down
How to backup the admserv.log file
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
There are no implicit OpenEdge utilities to truncate the admserv.log file while the AdminServer is online.  

There's no 'prolog' equivalent for the AdminServer log file (like the database), 
nor the concept of more than one admserv.log file that can be used for file rotation (like the ubrokers and the database since 11.7.4). 

The primary reason for this is that the AdminServer Manages all and any configured Servers and needs to keep the admserv.log file open.
  • The AdminServer will need to be shutdown first then the admserv.log can be backed up and deleted with OS utilities while it is offline.
  • Since OpenEdge 11 the AdminServer can be shutdown with the -keepservers switch, without stopping all running Ubroker servers. For further information refer to Article:
While the AdminServer is online, OS tools can be used to truncate the admserv.log file:

On Windows or UNIX:

First change to a different sub-directory than the one where the existing admserv.log is located in.
    
[UNIX\WIN]:  cd <directoryname>

Then create a new admserv.log file that is 0 length in size.
 
[UNIX]:             touch admserv.log

[WINDOWS]:  

Option 2:  notepad admserv.log 
(Create an empty file, then save the file without adding anything to the file).
 

3.   Overwrite the existing admserv.log file with the new empty admserv.log.  
 
[UNIX]:            cp admserv.log to ..\admserv.log
[WINDOWS]:   copy admserv.log to ../admserv.log

On UNIX, the admserv.log file can be copied and replaced with a truncated or empty version while the AdminServer is online.

For example,
  • To create a new admserv.log with only the last 50 lines:
$   cp admserv.log newadmserv.log
$   tail -n 50 newadmserv.log > admserv.log
  • To simply empty the current admserv.log:
$   echo "" > admserv.log
Workaround
Notes
Keyword Phrase
Last Modified Date11/18/2021 5:05 PM

Powered by