Skip to content

Integrate RoadRunner logger #156

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hungthai1401
Copy link
Contributor

@hungthai1401 hungthai1401 commented Jul 15, 2025

Description

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I wrote unit tests for my code (if tests is required for my changes)
  • I have made changes in CHANGELOG.md file

Summary by CodeRabbit

  • Documentation

    • Updated the changelog to include the new RoadRunner Logger integration.
    • Added a section to the README with setup instructions and usage examples for the RoadRunner Logger.
    • Updated the Table of Contents in the README.
  • Chores

    • Added the RoadRunner Logger package as a new dependency.

@hungthai1401 hungthai1401 requested a review from butschster as a code owner July 15, 2025 02:16
Copy link

coderabbitai bot commented Jul 15, 2025

Walkthrough

Documentation and configuration files were updated to reflect the integration of the RoadRunner Logger. The changelog and README were revised to describe the new feature and provide usage instructions, while the composer configuration added the required package dependency for the logger.

Changes

File(s) Change Summary
CHANGELOG.md Added entry for RoadRunner Logger integration under the "Added" section.
README.md Added a new section detailing RoadRunner Logger integration, usage instructions, and examples.
composer.json Added "hungthai1401/laravel-roadrunner-logger" as a required dependency.

Poem

In the warren of code, a logger appears,
RoadRunner’s tracks now crystal clear.
Composer’s basket gets a new treat,
Docs updated—guidance complete!
With every log, we hop ahead,
Debugging’s joy, no longer dread.
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
README.md (2)

405-410: Missing fenced-block language identifier

Markdown-lint flags this snippet: the .env fragment is inside a plain triple-back-tick block without a language tag.

Add dotenv (or at least bash) to silence MD040 and enable proper highlighting:

-```
+```dotenv
 RR_RPC=tcp://127.0.0.1:6001

---

`419-423`: **Minor duplication**

Given the corrected example above, the `Log::channel('rr')` snippet alone is sufficient; consider dropping one of the two to avoid redundancy.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 47c04daa7bb973167c451105d31f98962fbf6155 and bf42ca4793c41860207ea00ddd3d80ea435497d6.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `CHANGELOG.md` (1 hunks)
* `README.md` (2 hunks)
* `composer.json` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

<details>
<summary>README.md</summary>

407-407: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>composer.json (1)</summary>

`46-48`: **✅ Hungthai1401/laravel-roadrunner-logger v1.0.0 checks out**

- PHP constraint: requires ^8.1 → covers this lib’s ^8.2  
- No security advisories found in FriendsOfPHP/security-advisories  
- No other runtime requirements beyond PHP → no new conflicts  

You can safely merge as-is.

</details>
<details>
<summary>CHANGELOG.md (1)</summary>

`8-11`: **Changelog entry looks good**

The new bullet clearly states the added feature and follows the existing “Added” section style.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment on lines +413 to +415
```php
logger('rr')->info('This is an info message');
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Incorrect usage example – logger('rr') logs a message, not selects a channel

In Laravel the logger() helper treats the first argument as the message.
To obtain a logger for a specific channel you need:

-logger('rr')->info('This is an info message');
+logger()->channel('rr')->info('This is an info message');

or simply keep the Log::channel('rr') example below.

Please update to prevent confusion.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```php
logger('rr')->info('This is an info message');
```
🤖 Prompt for AI Agents
In README.md around lines 413 to 415, the example using logger('rr')->info('This
is an info message') is incorrect because the logger() helper treats the first
argument as the message, not as a channel selector. To fix this, replace the
example with the correct usage for logging to a specific channel, such as using
Log::channel('rr')->info('This is an info message'), or remove the incorrect
example and keep the existing Log::channel('rr') example to avoid confusion.

@butschster butschster requested a review from roxblnfk July 23, 2025 09:27
@butschster butschster self-assigned this Jul 23, 2025
@butschster
Copy link
Contributor

@roxblnfk What do you think about using for logger a third party pacakge?

@roxblnfk
Copy link
Member

@butschster I think that the need for an RR-PSR logger arose with the addition of PSR logger support in Temporal.

Providing the ability to log in RR in different ways (STDERR and RPC) is the right move, but our security policies do not allow us to easily use third-party libraries in common packages.

I have considered moving the Monolog Handler from RR-Spiral-Bridge to a separate package, but haven't gotten around to it.
Perhaps @hungthai1401 would be willing to participate in this.

@hungthai1401
Copy link
Contributor Author

@butschster @butschster I'm willing to join in. It will help me to learn more.

@roxblnfk
Copy link
Member

roxblnfk commented Aug 3, 2025

I've created repository and issue for this roadrunner-php/psr-logger#3

@hungthai1401
Copy link
Contributor Author

hungthai1401 commented Aug 4, 2025

@roxblnfk Sorry, I can't access it

@roxblnfk
Copy link
Member

roxblnfk commented Aug 4, 2025

@roxblnfk Sorry, I can't access it

Forgot make it public 🤦

Sign up for free to 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.

3 participants