We may have often come across use case to enable the AR Server logging during scheduled job execution time such as AD job sync or any such integration jobs.
This blog I’m to provide automated way of enabling AR Server side logging using ar driver utility. This has been tested with AR Server 8.1 and 9.1 versions.
Before we enable logging it is import ensure that you have sufficient disk space and number of back up files.
You can set these parameters using AR Server Administration Log files tab, set values for Maximum Log File Size (byte) and Maximum Backups.
Below example will create 10 log files each with size of 1GB.
Max-Log-History: 10 (1- 999)
Max-Log-File-Size: 1073741824 (1GB in bytes)
The below line of codes are completely based on the AR Server driver utility specified above as of AR Server 18.05 these driver utility is being installed as part of the AR Server installation. Default installation path for these drivers are:
Windows \Arserver\api\driver
UNIX /ARSystem/api/src/driver
In this example code I’m creating a combined log file of SQL, Filter, Escalation and API.
Step 1: Copy the below lines to a text file and save as LogginOn.txt
Note: These blank lines are required for performing the auto answers do not remove them.
log
<Login User>
<Login User Password>
<Login AR Server Name>
init
ssp
<Login AR Server Password>
ssi
5
17
4
E:\Program Files\BMC Software\ARSystem\ARServer\Db\combinedapisqlfilresc.log
21
4
E:\Program Files\BMC Software\ARSystem\ARServer\Db\combinedapisqlfilresc.log
31
4
E:\Program Files\BMC Software\ARSystem\ARServer\Db\combinedapisqlfilresc.log
34
4
E:\Program Files\BMC Software\ARSystem\ARServer\Db\combinedapisqlfilresc.log
8
2
27
term
Step 2: Copy the below lines to a text file and save as LogginOff.txt
log
<Login User>
<Login User Password>
<Login AR Server Name>
init
ssp
<Login AR Server Password>
ssi
1
8
2
0
term
q
Step3: Copy the file ile in the driver location or any location. <ARS_HOME>\Arserver\api\driver
Step 4: Create a batch file as StartLogging.bat with following files
echo “Logging Started”
cd <ARS_HOME>\Arserver\api\driver
driver < “<ARS_HOME>\Arserver\api\driver\LogginOn.txt”
Step 5: Create a batch file as StopLogging.bat with following files
echo “Logging Stopped”
cd <ARS_HOME>\Arserver\api\driver
driver < “<ARS_HOME>\Arserver\api\driver\LogginOff.txt”
Step 6: Create a Schedule job using Task Scheduler / Cron or any other scheduling tool such as Control-M and call the StartLogging.bat to begin the logging and call the StopLogging.bat to stop logging.
Debug and Log file path bit values available in ar.h file in <ARS_HOME>\Arserver\api\inlucde
Property | Debug Mode Bit Value | Log File Value |
SQL | 1 | 17 |
Filter | 2 | 21 |
User | 4 | 22 |
Escalation | 8 | 31 |
API | 16 | 34 |
Thread | 32 | 59 |
Alert | 64 | 144 |
arforkd | 128 | 123 |
Server Group | 256 | 193 |
Full Text Indexer | 512 | 217 |
DSO | 32768 | 46 |
Approval | 65536 | 93 |
Plugin | 131072 | 155 |