Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Can I send the Wordpress Debug Log to the Cloudron Logs

    WordPress (Developer)
    2
    8
    146
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Lonkle
      Lonkle last edited by

      I think I can do this via PHP settings. But I have to know the path of the logs to append the PHP / WP errors

      1 Reply Last reply Reply Quote 0
      • girish
        girish Staff last edited by

        Cloudron logs is anything that appears on standard output/error. If there is a way to send WP logs to stdout, then it should appear. FWIW, if i use error_log in PHP, it does appear in cloudron logs. But maybe WP writes to a file directly. Maybe try /dev/stdout as the file name for the logs, not sure.

        Lonkle 2 Replies Last reply Reply Quote 1
        • Lonkle
          Lonkle @girish last edited by

          @girish Thanks for info, I’ll do that, and yeah, they do write to their own file but that directory is easily changeable. ☺️ I don’t see a reason why your suggestion wouldn’t work tho.

          1 Reply Last reply Reply Quote 0
          • Lonkle
            Lonkle @girish last edited by

            @girish By defaut, Wordpress does a:

            ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
            

            And I don't think it would be a bad idea for you guys to add to your custom plugin an ini_set( 'error_log', '/dev/stdout' ); (this would need go into a plguin to load after WP sets it's PHP logging location).

            But, though I can now use ini_set( 'error_log', '/app/data/ . $path); to write the logs to to any location within /app/data - I tried setting it to /dev/stdout didn't start displaying the logs in Cloudron's Realtime Logging system. Any idea why I could change it to any directory and it worked, but that didn't?

            1 Reply Last reply Reply Quote 0
            • Lonkle
              Lonkle last edited by

              @Lonk said in Can I send the Wordpress Debug Log to the Cloudron Logs:

              ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );

              Did a little digging around some more Docker stuff and this worked perfectly:

              ini_set( 'error_log', '/dev/stderr' );
              
              1 Reply Last reply Reply Quote 1
              • girish
                girish Staff last edited by

                I think it's most likely permissions related. That /dev/stdout is probably not opeable by non-root user (and WP runs as www-data user).

                I have long wanted to fix our situation that we can get the logs from files inside containers. For example, nextcloud also logs into /run/nextcloud/logs/... It's a pain to keep informing users that the logs are in that file and not just the Cloudron logs.

                I agree we should visit this at some point for better logging

                Lonkle 2 Replies Last reply Reply Quote 1
                • Lonkle
                  Lonkle @girish last edited by Lonkle

                  @girish Check my comment right about yours, I think we posted at the same time. I'd think it'd be a welcome addition to at least your Wordpress (Developer) installs.

                  1 Reply Last reply Reply Quote 0
                  • Lonkle
                    Lonkle @girish last edited by Lonkle

                    @girish said in Can I send the Wordpress Debug Log to the Cloudron Logs:

                    I agree we should visit this at some point for better logging

                    This fixes the Wordpress "custom log path issue". But I do think we should revisit in the future about other apps and how we might be able to symlink the logs together. Anyway, you got me 75% there on this one, so thank you for that! ☺️

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB