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

[5.x]: Error message logging not working #14863

Closed
bencroker opened this issue Apr 26, 2024 · 4 comments · Fixed by #14877
Closed

[5.x]: Error message logging not working #14863

bencroker opened this issue Apr 26, 2024 · 4 comments · Fixed by #14877
Assignees
Labels

Comments

@bencroker
Copy link
Contributor

bencroker commented Apr 26, 2024

What happened?

Calling Craft::error() appears to have no effect in Craft 5.0.5.

Steps to reproduce

  1. Enable devMode.
  2. In a custom module, call Craft::error('Test error') and Craft::info('Test info') in the init() method.
  3. Visit the site.
  4. Open the web-****-**-**.log file.

Expected behavior

Both test messages should be written to the log file.

[web.ERROR] [application] Test error
[web.INFO] [application] Test info

Actual behaviour

Only the info message is written to the log file.

[web.INFO] [application] Test info

Craft CMS version

5.0.5

@bencroker bencroker added the bug label Apr 26, 2024
@MatthiasBrodelet
Copy link

I have been breaking my head over this issue.
The weird part is that Sentry is able to catch these errors even though they are not visible in the logs.

@timkelty
Copy link
Contributor

Confirmed the described behavior.

Errors are also missing with Dev Mode off, but warnings are logged.
Most likely related to the Monolog update that came with Craft 5.

Working on it now!

@timkelty timkelty linked a pull request Apr 26, 2024 that will close this issue
@bencroker
Copy link
Contributor Author

Thanks, Tim!

@brandonkelly
Copy link
Member

Fixed in 5.0.6! Thanks again.

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 a pull request may close this issue.

4 participants