This page may contain affiliate links. Please read my disclaimer for more information.

Gravity Forms Tip: How to Access Log Files Directly from the Entry Details Page

  |  by Chris Eggleston

The Problem

We troubleshoot and review a good amount of forms for Gravity Forms users, and I was recently annoyed that I could not quickly access the logs from the entry details page. Instead, you would need to go to Forms > Settings > Logs, which is a few too many steps when you’re in a hurry.

I thought the entry details page would be a smart place to have a button since the notes section on that page is often the first place a user would look for an indication of an issue.

How To Fix It

I initially wanted to add the button to the notes section, but decided it would be best to keep the button separate and instead added a new meta box to the page.

As you can see, this solution only displays a button for the core log files. With some code modification, you could add a button for any add-ons with enabled logging.

This is the code that makes this possible:

How To Implement This Code

Copy and paste the code above to your themes functions.php file or use a code snippet plugin like WPCodeBox.

You do not need to make any modifications, but logging will need to be enabled. If it is not, instead of a button, you will see this message: “Log file not found.”.

If you wanted to make this a separate plugin, you could do that as well.

  1. Create a new folder (directory), name it gr-log-button
  2. Create a new PHP file with that folder/directory, name it gf-log-button.php
  3. Copy and paste the plugin header below to the file.
  4. Copy and paste the code above to a file below the plugin header.
  5. Save your changes.
  6. Zip up the file.
  7. Upload the file via the WordPress plugin installer.
  8. Activate the plugin.
<?php
/*
Plugin Name: GravityRanger GF Log Button
Description: Adds a button to view Gravity Forms core log file within the entry details page.
Version: 1.0
Author: Chris Eggleston
Site: https://gravityranger.com
*/

Need More Help?

If you run into issues with this code or have any questions, please use the comments below, and we’ll be sure to get back to you.

Photo of author
About the Author
Chris Eggleston
Chris is not just a Gravity Forms enthusiast; he's a dedicated father and loving husband. As the proud owner of WP Mantis, he's on a mission to simplify the WordPress experience for site owners. He brings a unique perspective to the Gravity Forms community.

Advertisement

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments