Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds commands for showing container logs #51

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

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?

@@ -3,25 +3,6 @@
"description": "Planet 4 development environment",
"author": "Planet 4",
"scripts": {
"env:usage": "node usage",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is env:usage no longer needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's still there, but now is usage since it's a generic command. See 1d4564d

@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.

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.

2 participants