Edx/var/log/tracking/

Why tracking.log, under /edx/var/log/tracking/ is not updated.

Hi @HsuMonKo - as mentioned in a previous thread, if you would like to get help, you need to provide more details. What you were trying to do, and what you tried to debug the issue.

Hi @antoviaque, thanks for trying to help me. I’m setting up insights in my openedx site. tracking.log file which is useful in running the tasks to update insights is not updated.
I register new acc at my openedx site, enroll some courses and doing activities yesterday. But when i check the log file today, these activities are not updated in that tracking.log under /edx/var/log/tracking.

Hi HsuMonKo,
OpenEdx logging maintained by rsyslog system service. And log file periodically rotated by logrotate cron job. May be something get wrong in rotation script or rsyslog does not works…
Try to issue systemctl status rsyslog command and if there are errors try systemctl start rsyslog or systemctl restart rsyslog.

Also make sure that file /etc/rsyslog.d/99-edx.conf exists with this content - https://github.com/edx/configuration/blob/master/playbooks/roles/common/templates/edx_rsyslog.j2

Alright, thanks a lot. I’ll try it.

Hello @andrey.kryachko, when i check rsyslog’s status, it’s active. Then /etc/rsyslog.d/99-edx.conf also exists with the content in https://github.com/edx/configuration/blob/master/playbooks/roles/common/templates/edx_rsyslog.j2. But log file still doesn’t update.

please try to login to openedx (to make sure that tracking event generated) and then run this command on instance sudo lsof -nn -p $(pidof rsyslogd)

the output must contain all logfiles currently open by rsyslog.

...
rsyslogd 836 syslog    6w   REG 253,1 707296    560 /var/log/syslog
rsyslogd 836 syslog    7w   REG 253,1 1730789  2089 /var/log/auth.log
rsyslogd 836 syslog    8w   REG 253,1 197280    3082260 /edx/var/log/lms/edx.log
rsyslogd 836 syslog    9w   REG 253,1 590317    2332092 /edx/var/log/tracking/tracking.log

if not, try systemctl restart rsyslog. or try to reboot the instance.

Really thanks for your help. I’ll try it.

Hi @andrey.kryachko, when i run sudo lsof -nn -p $(pidof rsyslogd), the output contains
/var/log/syslog,
/var/log/auth.log and
/edx/var/log/lms.edx.log. But /edx/var/log/tracking/tracking.log is missing. Then i tried systemctl restart rsyslog, but /edx/var/log/tracking/tracking.log is still missing. :cry:

Hi HsuMonKo,

you wrote:

/var/log/auth.log and
/edx/var/log/lms.edx.log. But /

/edx/var/log/lms.edx.log - is this really what you see in the output or just a mistyping?
The LMS log file, according to configuration must be stored as /edx/var/log/lms/edx.log. If this is true, then something is wrong in your /etc/rsyslog.d/99-edx.conf configuration, please replace it with original and restart rsyslog service.

If that was mistyping, then try to check the tracking.log file owner and attributes. If they are differs from

$ ls -la /edx/var/log/tracking/tracking.log
-rw-r----- 1 syslog adm 568941 Dec 27 08:22 /edx/var/log/tracking/tracking.log

try to fix it and then restart rsyslog service.

sudo chown syslog:adm /edx/var/log/tracking/tracking.log
sudo chmod 0640 /edx/var/log/tracking/tracking.log
sudo chown root:root /edx/var/log/tracking
sudo chmod 0755 /edx/var/log/tracking

Sorry @andrey.kryachko.
It’s really is /edx/var/log/lms/edx.log.
/edx/var/log/lms.edx.log was mistyping. Sorry for my mistake. I’ll try what u said. Thanks.

Hi @andrey.kryachko, really thanks and srry for my late reply.
tracking.log is finally updated by following your suggestions.
I have another question :smiley:
tracking.log file under hadoop, (hdfs dfs -ls /data) also need to be updated (because i’m trying to get analytics on my openedx.)
But the one under hadoop is not updated.

Hi HsuMonKo,

in production environment the /edx/var/log/tracking/tracking.log-* files usually synced from all app instances to S3 bucket by some cron job (as described in this article).

According to step 5 of single-box installation notes tracking.log’s is copied to dedicated “analytics stack instance” where been processed by this cron job.

I see where we start with file permissions issue! You try to install analytics_pipeline on same machine where LMS is running and owner of tracking.log was changed to hadoop user. I can suggest to add hadoop user to adm system group to be able to access tracking.log file - sudo usermod -a -G adm hadoop

Thanks @andrey.kryachko. I’ll try it.