Mediawiki service – where are the logs

I am trying to debug some issues with my mediawiki instance (PdfHandler sometimes not working), and I have a hard time to even see error logs from mediawiki. They do not appear in /var/log/httpd/error*.log nor the systemd journal, and I am running out of ideas where to look.

Also adding $wgDebugLogFile = "/var/log/httpd/mediawiki.log"; to the extraConfig seems to have no effect.

if you’re using the NixOS module then consider that mediawiki doesn’t run as the www-run (httod service) user and won’t have access to that folder.

you might consider creating a logs directory for mediawiki, granting ownership to it, then writing logs there.

perhaps that will solve your problem.

Ah, indeed. For some reason I believed that being in the wwwrun group would suffice to create the log file, but that’s not the case (only the wwwrun user has write permissions).

With

# ls -l /var/log/mediawiki.log
-rw-r--r-- 1 mediawiki root 72147  5. Feb 13:25 /var/log/mediawiki.log

manually created and

      $wgDebugLogFile = "/var/log/mediawiki.log";

I get the logs. Thanks!

(Curiously, the issue with PdfHandler also disappered by itself :person_shrugging: .)

1 Like