usageEventlogs process

Hello, I install ojs2.4.8, in my usageEventlogs I found my log is only the latest one, and my articles abstract views and PDF views are almost zero or no change, this kind of phenomenon lasted for more than 10 days, I worry about not because system before processing logs them have been cleared away, and then log should have statistical processing of data is lost, cause my data has not changed.Please help meScreenshot_2018-08-20%20SAE%20Editor
Thank you very much

The files in usageStats/usageEventLogs are intended to move from that folder to the usageStats/processing and then usageStats/archive folders, as part of recording the statistics in the metrics table in the database. In the event of error, they will move from the usageStats/processing directory to the usageStats/reject, and a message will be sent to the Site Administrator by email.

What do those other directories look like?

As of yesterday, all the logs were in the archive, and all the other folders were empty. Does this mean that my data has been processed normally, but why the views count has not changed

I checked my metrics table and found that the latest record was from July, which was confusing to me,can you help me?Screenshot_2018-08-20%20SQL%20%E6%9F%A5%E8%AF%A2%E7%BB%93%E6%9E%9C%20-%20phpMyAdmin%203%203%208%201

Take a look at the files in files_dir/scheduledTaskLogs. There should be reports on each run for the Usage Statistics File Loader task, something like:
Usagestatisticsfileloadertask-5b79f13779ddd-20180819.log

The filename might be translated if you don’t have en_US as your default locale for the site.

Yes, I have found b79f13779ddd Usagestatisticsfileloadertask - 5-20180819. The log, but I still don’t know what to do next, please excuse my stupidity ,before the problem is not appear, until I transfer the system from the local to the cloud server.Screenshot_2018-08-20%20Screenshot
I wonder what /data1/www/htdocs/190/ means.
Thank you

This log indicates that it read and successfully processed the log file for August 13 on August 14th.

The first line indicates what base URL was used. The timestamped lines describe the steps of the processing.

The directory /data1/www/htdocs/190/ represents where OJS is installed on the system. Presumably your user has an id of “190” on this shared virtual machine.

Next, I would look at the contents of usage_events_20180813.log. Check for any URLs in that log which should have represented a legitimate user access. If a corresponding entry does not appear in the metrics table, the next step will be debugging the code.

content is as follows:Screenshot_2018-08-22%20Screenshot
metrics is as follow:Screenshot_2018-08-22%20SQL%20%E6%9F%A5%E8%AF%A2%E7%BB%93%E6%9E%9C%20-%20phpMyAdmin%203%203%208%201(1) Screenshot_2018-08-22%20SQL%20%E6%9F%A5%E8%AF%A2%E7%BB%93%E6%9E%9C%20-%20phpMyAdmin%203%203%208%201
I transferred the system to the cloud server on July 25, and the data was not updated after that.
Thanks

Logs are processed into metrics by either a scheduled “cron” job, or by periodic handling of the Acron generic plugin. If the files are moving from the “usageEventLogs” directory to the “processed” directory, it seems like this is happening successfully.

The example content you show from the log does represent accesses which should be converted to metrics, provided the base_url matches. For example, issue/view/2 and article/view/11, without the “bot” designation, would both be metric-eligible.

Your SQL query in phpMyAdmin has been limited to 50 rows. Have you confirmed that a select such as the following returns no results:

SELECT * FROM `metrics` WHERE load_id LIKE 'usage_events_201808%';

?

Yes, I’m sure the results of the query are empty, and I don’t have fifty figures, and all you see is what you see.

Is it possible you are looking at the database from prior to the migration?

If you log in to the journal as a Journal Manager and navigate to “Stats & Reports”, then select “OJS usage statistics report”, does the resulting file have the most recent data?

Yes, I checked, but it doesn’t have the latest data, and it’s still the same data I used before converting the server.

@xiongfeiyan, are you comfortable making PHP changes?

My next step would be to add a line (or lines) of debugging code into the module that processes the logs into metrics.

I’d be particularly curious if this code is causing the line to be skipped:

A suggested change would involve adding an error line, similar to the earlier invalid log entry message:

There is a report of a similar situation by @ajnyga here, which you may want to follow, even though the version is different:

It would be worth to check what kind of base_url settings you have in your config.inc.php

Do they match the actual url of your installation? Have you defined custom base_url’s for your journal(s)?

I think base_url is ok at the moment,Screenshot_2018-08-25%20SAE%20Editor(1) Screenshot_2018-08-25%20SAE%20Editor
my website home page will automatically redirect to the only journal’s url, namely astp.applinzi.com/index.php/astp

I may not quite understand what you mean, but did you ask me to write a line of error validation messages into the file you said?That would be bad, because I don’t know where to start.

not necessarely related, but base_url[journal_path] = http://astp.applinzi.com/index.php/astp should be base_url[astp] = http://astp.applinzi.com/index.php/astp. But since you are using the common url structure, you do not probably even need a base_url setting for the context. The main base_url setting should be enough.

What should I do next,could you tell me?

I would first check that do you have log files from August in the files/usageStats/archive folder.

Then I would make sure that the base_url settings in your config.inc.php are correct and remove any unnecessary base_url settings from the file.

After that only option really is to try to debug the code as @ctgraham mentioned above. And then move one of the archived log files from august to the stage folder and see what ends up in the error log.

I guess you could add something like

error_log(print_r($entryData[‘url’], true);
error_log(print_r($assocId, true);
error_log(print_r($assocType, true);

Right before this line: https://github.com/pkp/ojs/blob/ojs-stable-2_4_8/plugins/generic/usageStats/UsageStatsLoader.inc.php#L182

Then you just need to trigger the scheduled tasks and then check the error_log and see what kind of values you see there in cases where the url has the /article/view/... or /article/download/...

Note that I do not have an installation of OJS 2.4.8, so @ctgraham is definitely a lot more help with that version.

What is the stage folder?Where I can find it?