WP-Discourse: How to change de logs directory, or disable it completely?

AI-generated summary

The discussion revolves around the WP Discourse plugin’s logging feature and its impact on server load. Thiago_Mobilon reports that the plugin’s constant writes to the uploads folder, which is stored in a S3 bucket, are causing server load issues. They need to either change the log files directory or completely disable logging.

Thiago_Mobilon confirms that the issue is related to the WP Discourse plugin, not WordPress logs. pfaffman suggests that the issue might be related to WordPress logs, but Thiago_Mobilon clarifies that they are looking to modify the WP Discourse plugin’s logging behavior.

angus acknowledges the issue and states that a fix will be included in the next release of the plugin. angus later announces that the upcoming release (version 2.4.8) will include a fix for the issue, as well as a setting to disable logging entirely. The release is currently under review and can be tracked through a GitHub pull request: https://github.com/discourse/wp-discourse/pull/472

Our uploads folder is in a S3 bucket. The logging feature from Wp Discourse is adding a lot of load to the server, due to the constant writes to the uploads folder.

I need to completely disable the WP Discourse logs, or at least change the path to the log files directory.

Is there a way to customize that with a hook, or maybe defining a variable in wp-config.php?

You’re talking about the logs created by WordPress? Or discourse?

Discourse.

I’ve already disabled all the specific log options in the plugin settings, but it still does a lot o R/W in the directory,

You mean this, right?

wp-discourse is a WordPress plugin.

Those are WordPress logs. So if you want to change them you should do something lke https://www.google.com/search?q=wordpress+limit+log+size&oq=wordpress+limit+log+size.

There could be somewhere here who knows, but that search, especially on Christmas, is likely going to yield faster results.

Hi Jay,

Sorry, i meant wp-discourse.

I don’t want to limit the size of the log. I need to change the directory that the plugin uses to save the log files, or completely disable the logging feature.

As i mentioned, our uploads folder is in a S3 bucket, mounted using Rclone. WP Discourse makes constant writes in this “logs-metafile.txt” file, and this increases the server load a lot.

I checked the log generator file from WP Discourse, and it fetches the wp_uploads_dir directly, so i don’t think there’s a official way to change the directory, right?

Thanks for this report @Thiago_Mobilon.

We’ll be making a change to address this in the next release of the WP Discourse plugin.

Just a note that the next release of the plugin 2.4.8 includes:

  • a fix for the specific issue @Thiago_Mobilon reported; and
  • a setting to disable logging entirely

The fix should address the issue you’re experiencing @Thiago_Mobilon so you shouldn’t need to disable logging, but you’re welcome to of course.

The release is currently up for review. When this PR is merged it’ll be released to wordpress.org.

https://github.com/discourse/wp-discourse/pull/472