Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect log directories from plugins or themes #310

Open
Clorith opened this issue Aug 21, 2022 · 1 comment
Open

Detect log directories from plugins or themes #310

Clorith opened this issue Aug 21, 2022 · 1 comment

Comments

@Clorith
Copy link
Contributor

Clorith commented Aug 21, 2022

Some plugins or themes may create log directories (see for example WooCommerce and their wp-content/uploads/wc-logs, as referenced in the original PR from #295).

The benefit to hardcoding the path to a log source is that you can give a very specific name to the search location in the drop-down, but it adds a layer of maintenance in adding or removing relevant entries; What if we instead implemented a solution that, when the search form is generated, checks if there are any *log* or *logs* directories within wp-content or wp-content/uploads?

The benefit to doing so would be to automatically detect log files from various sources, and not needing to maintain them our selves.

The drawback is that instead of WooCommerce Logs, it would need to be both generic, and dynamic. For example adding a new section called "Logs" (which could also include wp-content/debug.txt by default, if it is present), that has a new entry for each log directory discovered with wording like Log directory: $name.

@primathon
Copy link
Contributor

I think your proposed solution would probably work fine. In taking a look through a handful of sites that I manage, the only log directories I found in either of those locations were for WooCommerce. Other plugins likely create their own log files/directories and probably place them in those locations, but I don't have any immediate examples of what they might be. A dynamic solution might be a bit overkill, but again, I think it'd likely work fine.

Still a fan of just adding an entry for WooCommerce as described in the linked PR though :-) it's such a common plugin that I don't think the maintenance overhead would require significant changes, and you can always change to a more dynamic solution in the future if it's needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants