Delete Large System error logs records

Delete Large System error logs records

Problem:

for large Log files (over 1 million records)  When we select the  "delete all" button in the system log viewer in the support tab the system Crashed ! 

So How can  we delete these large  log files? 

Solution:

we can delete them from database using a query. 

Steps 

1- check Database type and connect to it .

navigate to folder : manageengine\Servicedesk\bin > 

changeDBServer.bat 

if the database is postgres : 
connect to it 
psql.exe -U sdpadmin -p 65432 -d servicedesk -h 127.0.0.1
password : sdp@123

if the database is MSSQL: 
connect to it 
mysql.exe -u root -P 33366 servicedesk



2- execute the following Query.

  servicedesk=# delete from errorlog;

To delete the error log entries which are older than 60 days for example , please execute the following query.

delete from errorlog WHERE DATE_PART(('day',(NOW() - to_timestamp(OCCURREDTIME/1000))) >60;