Read drupal log programmatically I want to get all the logs, which are available under admin/reports/dblog as shown in the screenshot below:


Below are the two approaches, I can think of:


Access logs programmatically in Python or PHP
Download the database as a SQL file and read the database


I am not sure if the above approaches are possible or not. Any suggestions, please?
Yes, assuming you have the dblog module enabled, that data is in the database, so you can use whatever language or method you want to extract and analyse it.

The data is kept in the watchdog table.