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

Bug: Logs Collector isn't collecting logs for Debug Toolbar #3376

Closed
paulbalandan opened this issue Jul 21, 2020 · 5 comments
Closed

Bug: Logs Collector isn't collecting logs for Debug Toolbar #3376

paulbalandan opened this issue Jul 21, 2020 · 5 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@paulbalandan
Copy link
Member

Describe the bug
I've noticed that we have a Logs collector for showing logs in the toolbar. But there are no logs shown in the toolbar. Even the Logs tab is not shown. I've even triggered an exception to be logged just to test this log collector but still no tab is visible. I've verified in the debugbar JSON file that Logs is included in the collectors.

Config\Toolbar has Logs collector active
Config\Logger has $threshold of 4
debugbar.json has this content for Logs before and after an exception:

{
            "title": "Logs",
            "titleSafe": "logs",
            "titleDetails": "",
            "display": {
                "logs": []
            },
            "badgeValue": null,
            "isEmpty": true,
            "hasTabContent": true,
            "hasLabel": false,
            "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACYSURBVEhLYxgFJIHU1FSjtLS0i0D8AYj7gEKMEBkqAaAFF4D4ERCvAFrwH4gDoFIMKSkpFkB+OTEYqgUTACXfA/GqjIwMQyD9H2hRHlQKJFcBEiMGQ7VgAqCBvUgK32dmZspCpagGGNPT0/1BLqeF4bQHQJePpiIwhmrBBEADR1MRfgB0+WgqAmOoFkwANHA0FY0CUgEDAwCQ0PUpNB3kqwAAAABJRU5ErkJggg==",
            "hasTimelineData": false,
            "timelineData": []
        },

CodeIgniter 4 version
Probably all versions

Affected module(s)
Toolbar, or Logs collector

Expected behavior, and steps to reproduce if appropriate
The Logs will appear as a tab in the Toolbar with the logs there.

Actual behavior
image
No signs of Logs tab

Context

  • OS: Win10
  • Web server Apache 2.4.41
  • PHP version 7.4.8
@paulbalandan paulbalandan added the bug Verified issues on the current code behavior or pull requests that will fix them label Jul 21, 2020
@michalsn
Copy link
Member

I've added log_message('error', 'The error says hi'); to the Home::index
$threshold in Config\Logger is set to 3 (by default).

Logs tab in the toolbar is visible.

@paulbalandan
Copy link
Member Author

So does that mean we need to manually trigger log_message in our code for the tab to appear??

@paulbalandan
Copy link
Member Author

I thought the Logs tab serves as a convenient way to view the logs in the writable folder for easy viewing. Am I incorrect?

@michalsn
Copy link
Member

The Logs tab should show log messages for the current request only.

@paulbalandan
Copy link
Member Author

So that's the missing keyword: current request. Thanks for the clarification. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

2 participants