Skip to content

Comments

Adds commands for showing container logs#51

Merged
comzeradd merged 4 commits intomainfrom
logs-command
Jan 24, 2025
Merged

Adds commands for showing container logs#51
comzeradd merged 4 commits intomainfrom
logs-command

Conversation

@comzeradd
Copy link
Member

@comzeradd comzeradd commented Jan 15, 2025

Some additional housekeeping commits.

Testing

npm run logs
npm run logs:php
npm run logs:mysql

@comzeradd comzeradd changed the title Logs command Adds commands for showing container logs Jan 15, 2025
@comzeradd comzeradd self-assigned this Jan 15, 2025
@comzeradd comzeradd marked this pull request as ready for review January 15, 2025 10:31
Copy link
Contributor

@mardelnet mardelnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, @comzeradd
I added this piece of code (error_log( 'Debugging is active!' );) to the functions.php file but I cannot see it logged in the terminal. Am I missing something?

@comzeradd
Copy link
Member Author

I added this piece of code (error_log( 'Debugging is active!' );) to the functions.php file but I cannot see it logged in the terminal. Am I missing something?

Hm.. yes that won't work. error_log doesn't send this out to the container logs. Probably xdebug would be more useful for things like that.

I didn't test with error_log, but when DEBUG is on certain errors and messages appear directly in the frontend. Even printing out variable values with var_dump.

@mardelnet
Copy link
Contributor

I added this piece of code (error_log( 'Debugging is active!' );) to the functions.php file but I cannot see it logged in the terminal. Am I missing something?

Hm.. yes that won't work. error_log doesn't send this out to the container logs. Probably xdebug would be more useful for things like that.

I didn't test with error_log, but when DEBUG is on certain errors and messages appear directly in the frontend. Even printing out variable values with var_dump.

Thanks, @comzeradd
The PR greenpeace/planet4-master-theme#2495 is particularly hard to debug by printing out variables because AJAX is involved, sometimes the page reloads after completing the process, etc. So I need a way to log variables during the entire process and not only at the end of it.
I've never used it xdebug before. I'll give it a try.

@comzeradd comzeradd merged commit 4a87817 into main Jan 24, 2025
5 checks passed
@comzeradd comzeradd deleted the logs-command branch January 24, 2025 13:44
@sagarsdeshmukh
Copy link
Member

@mardelnet - This might be useful for logging errors in the local dev environment. You can check the error log in the planet4-develop/planet4/debug.log file, when debug mode is On.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants