User tests: Successful: Unsuccessful:
As recommended in #5165, rebased the adding of categories for all log entries on staging branch.
For the intent, see above linked pull request
Labels |
Added:
?
|
I activated logging in the options menu of com_finder and checked the entries in log/indexer.php.
Example of an entry before applying the patch:
2014-11-23T16:22:33+00:00 INFO 127.0.0.1 - Starting the indexer
and after applying the patch:
2014-11-23T16:24:45+00:00 INFO 127.0.0.1 com_finder Starting the indexer
I also scanned the code for any typos as I also didnĀ“t know what more I could do. I am wondering if there is anywhere a list with all categories used in core joomla. You referenced http://docs.joomla.org/Using_JLog which explained the mechanism quite well, but I found no list of categories.
Being curious: did you come up with the category names "com_finder", "image", "daemon" or where the already present?
I might have actually gone a bit overboard here; however I do think the changes I made are very useful. Let me elaborate:
What I did notice in my extensions' custom log were messages like this
2014-03-24T14:37:38+00:00 INFO FinderIndexerAdapter::getTypeId
typically, I would get multiple of them (upon closer inspection, exactly 5) in quick succession.
Checking the JLog::addEntry code I came to the conclusion that it would actually only make sense for very rare error messages to really have no category - namely if they really should appear in each log file (because that is what will happen if no category is specified, unless the log level prevents it); so I simply added the category everywhere (without being able to tell exactly how to test each instance). To be honest, I cannot even tell how exactly to reproduce the messages shown above; I can only say that they occasionally appear on my production system.
And yes, I did come up with those category names, I'd also be curious about whether there is a list of existing/approved ones?
Rel_Number | ⇒ | 5165 | |
Relation Type | ⇒ | Pull Request for |
Labels |
Added:
?
|
@codeling There is no list of existing/approved category names.
Looking at the changes, only a category has been added which is actually an optional argument. Specifying no category means the same as specifying a category that is supported by a logger.
Although we do need a way to test this before we can merge it.
I have not tested this item.
Hello @codeling
Thank you for your contribution.
The last comment here was on 22 oct 2015. So the question is, Is this issue/pull request still valid?
if so please provide clear test instructions to be able to test / reproduce this issue.
If no reply is received within 4 weeks we will close this issue.
Thanks for understanding!
Status | Pending | ⇒ | Information Required |
Status | Information Required | ⇒ | Needs Review |
Its very unclear if this is correct or desired and can not be tested - setting to Needs Review for a Maintainer to make a decision on closing or merging
I am going to close this PR, since there is no proper way to reproduce this issue. Forcing a category shouldn't be necessary if you want it all in one log. Perhaps it would be better to not write to logs that have a category assigned but that would require a new pull request.
@codeling Thank you for your contribution.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-02-01 07:14:10 |
Closed_By | ⇒ | roland-d |
Part of the problem (I don't remember if that has been fixed either) is a log message with no category will be broadcast to all loggers regardless of include/exclude configuration. So one should ensure log messages are always assigned to a category and that JLog handles a no-category scenario correctly. This should be re-opened and merged.
I am going to close this PR, since there is no proper way to reproduce this issue.
OK.
Forcing a category shouldn't be necessary if you want it all in one log.
I don't want all in one logfile, I want a separate logfile which should not get entries without categories.
Perhaps it would be better to not write to logs that have a category assigned but that would require a new pull request.
That could be a solution. But where then would log entries with no category get logged? Nowhere? Or one would have to have a specific "catch-all" category...
The simplest solution to me still is to have proper log categories for all log entries.
thanks @codeling can you add a step by step way to reproduce the issue and / or test you patch?