Skip to content

Document PSR-3 logging best practices - #154

Closed
samdark wants to merge 1 commit into
masterfrom
docs/logging-best-practices
Closed

Document PSR-3 logging best practices#154
samdark wants to merge 1 commit into
masterfrom
docs/logging-best-practices

Conversation

@samdark

Copy link
Copy Markdown
Member
QA
Is bugfix?
New feature?
Breaks BC?
Fixed issues

Summary

  • document recommended exception logging through the PSR-3 exception context key
  • recommend dependency injection, structured context, and conservative log levels
  • clarify that metrics and tracing are preferable for measurements and durations
  • add equivalent guidance to the Russian documentation

The recommendations follow the Proper logging in PHP with PSR-3 article and describe capabilities already supported by the package.

Verification

  • composer test (291 tests, 505 assertions)
  • git diff --check

CopilotAI lite review requested due to automatic review settings August 11, 2026 13:17
@samdarksamdark closed this Aug 11, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds documentation for PSR-3 logging best practices to help users produce more structured, actionable logs, and mirrors the guidance in the Russian guide.

Changes:

  • Added a “Recommended logging practices” section to the main README, including guidance on exception logging via the PSR-3 exception context key.
  • Added equivalent recommendations to the Russian documentation guide.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

FileDescription
README.mdAdds PSR-3-oriented logging best-practices guidance and examples.
docs/guide/ru/README.mdAdds Russian-language equivalent guidance to keep docs aligned across locales.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +137 to +138
- Логирование и создание `Throwable` требуют ресурсов. Особенно внимательно используйте их в циклах. Логгер и его цели
по умолчанию буферизуют сообщения, поэтому в долгоживущих процессах настройте интервалы сброса и экспорта.
Comment on lines +131 to +134
- Выбирайте минимально достаточный уровень. Используйте `debug` для подробной диагностики (особенно в циклах), `info` для
штатных успешных операций и редких heartbeat-сообщений, `notice` для допустимых отклонений, `warning` для сбоев,
обработанных резервным сценарием. Более высокие уровни и оповещения согласуйте в команде. Heartbeat дополняет, но не
заменяет внешнюю проверку работоспособности; при большом объёме сообщений используйте семплирование.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@samdark