Usage Stats Not Generating Log Files in OJS 3.5.0-1 (PostgreSQL 17.6)

I am setting up a test environment using OJS 3.5.0-1 with PostgreSQL 17.6, but the system is not generating any access log files inside the /usageStats/usageEventLogs/ directory.

Data collection is enabled in the OJS settings, and there are no related error messages in the Apache logs.
The directory permissions also appear to be correct, but the log files are still not being created.

Does anyone know if there are additional steps, cron tasks, or configuration changes required for usage statistics to work properly in this version of OJS?

Regards,
Tarcisio Pereira

Update:
I have now conducted the same tests using OJS 3.5.0-2 (with PostgreSQL 17.6), and the issue persists exactly as described above.
No log files are generated inside the /usageStats/usageEventLogs/ directory, despite usage data collection being fully enabled and no errors appearing in the Apache error log.

File permissions remain correct, the path is properly configured, and the system behaves identically in both versions (3.5.0-1 and 3.5.0-2).
At this point, it appears that the Usage Statistics plugin is not producing any logging activity in the 3.5.x series under these conditions.

If there have been any recent changes to the logging mechanism in OJS 3.5.x — or if an additional task, configuration step, or scheduled process is now required — I would greatly appreciate any clarification or guidance.

Thank you in advance for any insight.

I’d like to add an important detail to this discussion.

To rule out any server-side or configuration issues, I performed two tests using OJS 3.5.0-2:

:white_check_mark: Fresh install test

I deployed a clean installation of OJS 3.5.0-2 on the very same server (same PHP version, same PostgreSQL 17.6 instance, same filesystem permissions).
Result:
Usage statistics work normally — log files are created in usageStats/usageEventLogs, moved to stage, and processed as expected.

:cross_mark: Upgrade / migration test

However, when I run an upgrade test using the same codebase and migrate an existing OJS installation to 3.5.0-2, the usage stats system stops working completely:

  • No log files are generated in usageEventLogs
  • Nothing is moved to stage
  • No entries appear in scheduledTaskLogs
  • Permissions and ownership are identical to the fresh install
  • salt file exists and is readable
  • No related errors appear in PHP or webserver logs

Since the fresh install works, but the migrated instance does not, it looks like something in the upgrade process might leave the usage statistics subsystem inactive or improperly initialized.

If anyone has insights about what part of the migration could affect the usage stats logging mechanism (e.g., task registration, job runner configuration, leftover plugin metadata, database flags), I would appreciate any guidance.

Hi @Tarcisio_Pereira

Hmmm… Strange… :slight_smile:
From which version are you upgrading?
Just in case: Because you said “Usage Statistics plugin is not producing any logging activity…”: Do you still have the UsageStatistics plugin? – It should be removed – the usage statistics are moved into core in 3.4.
But maybe you do not actually have it, because you managed to run the fresh install without problems…

When you do the upgrade you do not get any errors?

Actually the upgrade should not affect the log file creation after the upgrade :thinking:
Log file creation and writing in the log file happens in the core, by an event listener, that listens when a web page is requested by the user. So nothing special is needed here, except the right file and folder permissions. Also, the user should not have the option “do not track” set in their browser – in that case the usage will not be tracked.
Are your settings in the config.inc.php correct? The base_url and files folder?

Then, for log file processing, the scheduled task UsageStatsLoader is called, that creates lots of jobs. Per default the system internal scheduler and job runner are used, to run the scheduled tasks and jobs. But, maybe first we need to figure out why the log files are not created correctly.

Best,
Bozana

Hi @bozana

Just to clarify my setup and add more details:

  • I upgraded from OJS 3.4.0-4 to 3.5.0-2.
  • The upgrade process completed without any errors.
  • I do not have any UsageStatistics plugin installed (I previously used the wrong terminology).
  • I double-checked all related settings in config.inc.php (including base_url and files_dir), and everything seems to be correctly configured.
  • I am using the PKP scheduler and job runner via cron, with the following entries:
*/30 * * * * php /var/www/revistas/lib/pkp/tools/jobs.php run
* * * * * php /var/www/revistas/lib/pkp/tools/scheduler.php run >> /dev/null 2>&1

What I noticed behavior-wise is this:

  • Both the fresh install and the upgraded installation do generate usage log files, but only when I click to download the PDF.
  • No log files are generated when:
    • The article abstract page is viewed.
    • The PDF is opened directly in the browser (inline).
  • On older versions, I’m almost sure that abstract page views were also logged.
  • Additionally, even the few log files that are being generated are not being processed/imported into the statistics system.

So at the moment:

  1. Logging seems to be happening only on direct PDF downloads.
  2. Abstract and inline PDF views are not being logged.
  3. The generated logs are not being processed at all.

Is this the expected behavior in OJS 3.5, or does this indicate a malfunction in the usage stats pipeline?

Thanks in advance for any insight.

Hi @Tarcisio_Pereira

No, this is not the right behavior. I have just tested it locally, the abstract page views are logged, also the PDF viewing in the browser (if the whole file is visible i.e. downloaded in the PDF viewer), also the journal index page.
So I am wondering why it is not working for you… :thinking:

Regarding the processing of the log files: could you try not to use cron and to use the default settings in your config.inc.php, and maybe first with the fresh installation:
[queues]
job_runner = On

[schedule]
task_runner = On

Best,
Bozana

Hi @bozana

In the fresh installation:
[queues]
job_runner = On

[schedule]
task_runner = On

But OJS still isn’t processing the logs.
In your test, are you using php-FPM?

Regards,
Tarcisio Pereira

Hi @Tarcisio_Pereira

Yes, I use php-fpm…

Hi @bozana

May I ask which exact version of PHP you are using? Here, I have tested with both PHP 8.5 and PHP 8.4.11.

Regards,
Tarcisio Pereira

Hi @Tarcisio_Pereira

I use PHP 8.2