joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.76k stars 3.65k forks source link

Custom Logging #38689

Open brianteeman opened 2 years ago

brianteeman commented 2 years ago

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 commented 2 years ago

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 https://github.com/joomla/joomla-cms/issues/37677, I will note for communication.

brianteeman commented 2 years ago

except you stated

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

and I dont get that file at all

Kostelano commented 2 years ago

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

Kostelano commented 2 years ago

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 commented 2 years ago

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. https://github.com/joomla/joomla-cms/blob/e7f5cc182bb1cd39c7f085d529888ac4fa6fc77e/includes/framework.php#L79-L86

brianteeman commented 2 years ago

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

Fedik commented 2 years ago

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

It does not use JLog, but use DB QueryMonitor.

alikon commented 2 years ago

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

brianteeman commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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

Fedik commented 2 years ago

it doesnt resolve the issue

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