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

Custom Logging #38689

Open
brianteeman opened this issue Sep 5, 2022 · 12 comments
Open

Custom Logging #38689

brianteeman opened this issue Sep 5, 2022 · 12 comments

Comments

@brianteeman
Copy link
Contributor

brianteeman commented Sep 5, 2022

Steps to reproduce the issue

In global configuration set up custom logging as shown in the screenshot

image

perfrom a variety of things such as unpublishing content, filtering content etc etc

check the contents of the administrator/logs folder

Expected result

files that contain the logs of the database quries etc etc

Actual result

nothing at all

Additional comments

Am i missing something?

@Kostelano
Copy link
Contributor

I can confirm that the requests are not in the log file. This functionality is still quite crude and "intersects" a little in the parameters. I described in more detail in post #37677, I will note for communication.

@brianteeman
Copy link
Contributor Author

except you stated

Created file custom-logging.php, which mostly contains category deprecated entries.

and I dont get that file at all

@Kostelano
Copy link
Contributor

At me it is created and now, with it there are no problems.

@Kostelano
Copy link
Contributor

I take my words back, indeed logging is not working correctly now. For example, having the deprecated category in a field does NOT allow the system to log it until the option above is enabled. However, they do not need to be linked. Definitely something is wrong.

@Fedik
Copy link
Member

Fedik commented Sep 5, 2022

The field have an outdated description. On quick search "database", "databasequery" etc categories not used in J4 for every DB query, maybe because Joomla moved to freamwork database library. I found only a couple use in com_joomlaupdate. However some extensions also may use it.
Other categories should work, example jerror.
The categories not fixed, it can be anything you use while call Log::add().

For example, having the deprecated category in a field does NOT allow the system to log it until the option above is enabled.

Deprecated loging have a dedicated "switch" for a reason and loged separately, and better use that. Because it will produce a realy huge log file.
Also It is explicitely disabled when that switch is off, for prefomance reason.

// Check deprecation logging
if (empty($config->log_deprecated)) {
// Reset handler for E_USER_DEPRECATED
set_error_handler(null, E_USER_DEPRECATED);
} else {
// Make sure handler for E_USER_DEPRECATED is registered
set_error_handler(['Joomla\CMS\Exception\ExceptionHandler', 'handleUserDeprecatedErrors'], E_USER_DEPRECATED);
}

@brianteeman
Copy link
Contributor Author

so there is no way any more to log the queries that are taking place?

@Fedik
Copy link
Member

Fedik commented Sep 6, 2022

Enable debug, and make sure Debug plugin have "Queries => Show".
image

It does not use JLog, but use DB QueryMonitor.

@alikon
Copy link
Contributor

alikon commented Sep 6, 2022

probably removed when switched to the new system debug plugin phpdebugbar (i mean the .sql file with executed queries)

@brianteeman
Copy link
Contributor Author

@Fedik that doesnt help if you want to see the sql that took place between a page load. For example do any batch changes and then find out the sql that was run

@Fedik
Copy link
Member

Fedik commented Sep 6, 2022

that doesnt help if you want to see the sql that took place between a page load

it is, click this litle icon, and choose stored data to view:
image

Example POST request of saving an article:
image

@brianteeman
Copy link
Contributor Author

Thanks - didnt know about that. It solves my personal problem but it doesnt resolve the issue

@Fedik
Copy link
Member

Fedik commented Sep 6, 2022

it doesnt resolve the issue

I think it would be enough to update the field description, or?

@Hackwar Hackwar added the bug label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants