How can I export the log messages (Site Reports-->Recent Log Messages) in a .csv file?

2 Answers 2


You can use phpMyAdmin to export the watchdog table (or select entries) in csv format which excel can read.

If you do not have access of database, you can use Views, Views Watchdog and Views data export modules to accomplish this.


Create a "report" to select (and sort, etc) the log messages you want to export using the Forena module. And specify what kind of hyperlinks you want to make available for performing such "export". These hyperlinks correspond to various supported "formats", such as: CSV, PDF, XLS, XML, DOC, HTML ... (the "report designer" selects what the allowed/enabled export formats for a report are). To get an idea of how that would look like, visit the Customized Simple Table of States. Notice the links in it, such as "CSV" (upper right), which in this case would "export" the results in a CSV file.

Drupal admin reporting

The Forena 'Drupal Admin' reports is 1 of the sets (categories) of reports, that come out of the box with Forena. By default they can only be accessed by users with role "admin" (unless you adapt the permissions to access them by other roles also). So if somebody installs Forena in a Drupal site, and they have the "admin" role, then they get access to all sorts of Drupal admin related reports (like watchdog reports) in their "own" environment. Some of those reports are:

  • Active Users - A variation of D7's admin/people, including hyperlinks to the Logs for User report.
  • Logs for User - Most recent watchdog log entries for a user (specified as a report parameter).
  • Role Details - A table displaying all users for a Drupal role (specified as a report parameter), and the Drupal permissions granted to them, with for each user hyperlinks to either view or edit the user's profile.

For this specific question, you should be interested in the "Logs for User" report. You could use it to clone (copy) it into a custom report that fits your exact needs. For an example of how I ever create a variation of that report, have a look at my answer to "Which Drupal log file is available to proof when exactly some content was deleted and by whom?". Here is how that variation (custom report) looks like:

enter image description here

More details about Forena

For more details about Forena, 2 types of documentation are available:

  • Community documentation, which includes a child page Video demos and tutorials.
  • Documentation that comes with Forena, which you can access right after you install and enable of the module. Checkout the demo site for an online example of the current:

    • Forena documentation - use the link 'Reporting documentation' or visit relative link /reports/help.
    • Forena samples - use the link 'Reporting samples' or visit relative link /reports/samples (these samples are fully functional, so make sure to experiment a bit with it, such as the drill downs available on the SVG Graph sample).

Disclosure: I'm a (co-)maintainer of Forena.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.