Can I send the Wordpress Debug Log to the Cloudron Logs
-
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/stdoutas the file name for the logs, not sure. -
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/stdoutas the file name for the logs, not sure. -
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/stdoutas the file name for the logs, not sure.@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/stdoutdidn'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? -
@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' ); -
I think it's most likely permissions related. That
/dev/stdoutis 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
-
I think it's most likely permissions related. That
/dev/stdoutis 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
-
I think it's most likely permissions related. That
/dev/stdoutis 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
@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!
️
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login