Closed (fixed)
Project:
Util
Version:
6.x-3.x-dev
Component:
Dblog_extension
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
15 Sep 2009 at 22:04 UTC
Updated:
5 Nov 2009 at 00:14 UTC
Jump to comment: Most recent file
Comments
Comment #1
nancydruYes, I was thinking about doing parts of that any way, although not as "pretty." "Clear all" is already handled by not filtering on anything. I would like to see settings for "recent" and "old." Another thing I was thinking of, but am not sure can be done without a hack is to filter on user.
Submit a patch, please.
Comment #2
arhak commentedthen..
do you encourage me to go for it?
I wouldn't like to spend time cleaning code if it won't be even considered for possible commit
BTW, wouldn't be the same to filter on anything than clearing the log, when I have some tricky bug dumping errors into my logs I use to clear all logs to see what's new, and I'm talking about the same message, so it wouldn't be possible to filter.. unless having a date/time filter I guess
Nevertheless, on development I prefer to delete than filter logs, that's why I use those criterias
which, by the way, aren't fixed, since the callback would handle any integer argument passed (it could have a textfield for the minutes or logs amount but would require a submit button then, I thought links are handier)
what for the "recent" and "old"? kind of quick-links to filter?
I could add that feature..
let me know if there is any change to get this features into this module and I will provide patches
PS: do you prefer patches against dev? being so decoupled it wouldn't be necessary right?
Comment #3
nancydruIf it is an enhancement to the current feature, then yes, it should be a patch against the current -dev. Plus, the base util.module has an improvement to its settings page and menu to make adding new features easier. Otherwise, just package the code up with a .info file and a CSS and/or .install (if needed).
Yes, go for it.
As for "recent" and "old": some people might consider "recent" to be the last half hour or last 5 minutes and "recent" to be the last hour or two; that's why I suggest settings.
Links or buttons aren't a whole lot different, except for the amount of text you can put on them.
Comment #4
nancydruComment #5
arhak commentedwell, having filters for recent/old and a "clear" button makes the whole functionality of what I initially proposed
though, I made a module for recent/old
but... it needs a minor collaboration from dblog module
actually I made a home version which duplicated dblog functionality, but that wouldn't be necessary if dblog would have a hook for its filters
therefore, I provided a patch for Drupal 7.x-dev
do you think it would be on time?
would you give some feedback on #582622: provide hook for dblog_filters
see the screenshot and tell me if thats what you want
BTW recent/aged times are configurable, just an array with minutes amounts
Comment #6
arhak commentedthe module dblog_time_filters
the screenshot dblog_time_filters.png
Features:
- optionally offers recent and/or aged filters
- times are configurable as shown in one of the screenshots
- optional integration with util module (otherwise makes its own settings page)
Important:
- I didn't like to duplicate dblog's behavior, thus a patch must be applied for this module to work
this patch is available for both D6 #582672: dblog support filters through a hook (6.x) and D7 #582622: provide hook for dblog_filters
Notes:
- the recent/aged filters appear before due to alphabetical order, changing the weight of the module would make them go bellow
- the "clear" button in the screenshot is from clear_log module bundled with util module
- I needed the "- None -" option for Firefox (not for Chrome), because couldn't unselect (Ctrl+click) the single select, I can with select having multiple="multiple" or multiple="false", but having no "multiple" attribute in FF2 doesn't allow me to unselect
Comment #7
nancydruThanks, I will look at this in detail after I get some other things done. Some initial comments: 1) I don't like duplicating functionality either, but it's not good practice for a contrib to require a patch to core; 2) there doesn't seem to be the user filtering, but it would probably be easy to add with your hook; 3) "-none-" is probably good any way, 4) I wonder if there is a way to add a resizing "grippie" to the lists like Hierarchical Select does.
Comment #8
arhak commented1) I can mirror dblog's functions allowing hooks and use menu_alter to active mines instead. Would it be preferable?
2) no user filtering, but yes, it would be easy with the hooks
3) actually "-none-" is required, since non-multiple selects can't be unselected, same as drop down lists
PS: please, also review the D7 patch (it might get into code freeze)
Comment #9
arhak commentedthe original intention of this post was to provide another module for the util package, but being more flexible and generalizing the use case, it doesn't makes sense to have util module as a dependency, since these modules stand by them self
nevertheless, I declared
package=Utilin case you like themdblog_ext - provide hooks for dblog_filters
(the same what the patch does to dblog, thus mimics dblog)
dblog_clear - doesn't requires dblog_ext, but integrates really good with dblog_filters
(old log_clear in util package, making its name consistent with what it actually does)
dblog_filters - requires dblog_ext or the patch (available for D6 and D7)
dblog_time_filters - (pending date/time filter, but has recent/aged filter)
dblog_user_filter - (with autocompletion)
dblog_host_filter - (without autocompletion but support contains/starts/ends/exact matches)
three last modules relies on dblog_filters
and taking advantage of that they don't have to do much
as an example, I post bellow the WHOLE module
Comment #10
arhak commentedComment #11
nancydruWhile requiring a core patch is not without precedent, I don' like having to do that, so please go ahead and reproduce dblog's function.
There were several flags by the Coder module.
Regards your @TODO about MySql's NOW() function: it won't work here because it creates a datetime format value rather than a Unix timestamp.
Comment #12
arhak commentedshoot! didn't I uploaded the
dblog_extmodule already?I already implemented a module to provide the required functionality without the D6 patch.
I though I posted it here, but seems like I forgot.
Now attaching it.
Note that this would be the alternative to the patch, so no patch would be required and dependent modules are incompatible with the ones relaying on the D6 patch.
Please forgive the
coder's flags for now, I will clean up the code once functionality gets reviewed and approved by a couple of users.PS: taking note about
NOW()vs Unix timestamp. Nevertheless, the uploaded version dates from September 21, so the@TODOcomment is still there.Comment #13
arhak commentedI hit "Save" instead of "Attach", I shouldn't miss it twice..
Comment #14
arhak commentedmodules attached at #13 are described at #9
Comment #15
nancydruSystem_settings_form requires the form element name to be the same as the variable name:
Comment #16
nancydruI don't know if the count > 1 is a great idea. When there is only one, it is always filtering on that, which doesn't actually change the results. Perhaps a "-none-" should be used here too
Comment #17
nancydruComment #18
nancydruBTW, these are just suggestions.
Comment #19
arhak commentedthanks a lot for your detailed review
the TODO list would be:
1- the
coder's flags (@#11)2- change
@TODOcomment to document why PHPtimeover MySQLNOW(@#11)3- settings form bug: array index doesn't match variable name (@#15)
4- feature: add "- None -" option to host filter (@#16)
5- usability: non-sense condition
count($host_list) > 1(@#16)6- revamp user filter: use select list instead of autocomplete (@#17)
about the above list
5- I think I meant (but didn't do it) a select under certain threshold and a textfield if the count excedes the threshold (configurable threshold?). Note that the textfield might be used (configurable settings) to match starts/ends/contains/exact, nevertheless it might be implemented with autocompletion as well.
6- Are you sure about always having a select? It might be a huge select! I think it should be a select or autocomplete according to certain threshold (again: configurable threshold?)
Comment #20
nancydru5) I did a select list because a) the column is not shown (maybe should be), so how do they know? b) more consistent with core filters. On my sites I have never seen more than one hostname in the log, and I suspect for the vast majority, that's the way it will be. In production, I would never need to implement this filter.
6) One big problem here is that when modules like RealName are installed, the user's "realname" is displayed rather than their user name. People who use this type of facility don't want user names displayed - ever. While it could potentially be a huge list, I doubt that, in practice, it will be that large.
Comment #21
arhak commented6) If there is a log entry for every session opened/closed then the list of users would be as long as registered users exists in the site. am I wrong? am I missing something?
Yes I noticed you were looking realname support, but autocompletion would be the same than provided by core every where user autocompletion is used. right?
5) I never though about it. I implemented it because it was requested in some other issue marked as "won't fix". I though it would had some use case. But I think you are right.
Comment #22
nancydru5) Of course I'm right - I'm a woman! ;-) It is possible in a multi-site with shared tables that it could contain multiple values, but I think there are very few of them. I have not looked to see if the "syslog" implementation changes any of this.
6) Yes, on very busy sites with many, many users, this list could get long. However there aren't that many sites that really have that much traffic and that don't allow session data to persist over re-connections (for example, I only log in to DO once a day, even though I am "here" most of the time). Remember there is also a setting to limit how much data can exist in watchdog.
Autocompletion with RealName is a "sticky wicket" in its own right. AC will actually show the underlying username once the selection is done. ATM, we have not found a way around that. Core will not be providing alternate (or display) user names any time soon - the core developers are opposed to it. It is possible that proper display of username will get into D7, and that will allow a better intercept for substituting display names.
In the end, this is your baby, so do what you want.
Comment #23
arhak commentedremoved double post
(I couldn't remove #24, so removing #23 instead, http://drupal.org/comment/edit/2128522 keeps giving me 503 Service Unavailable)
Comment #24
arhak commentedtruly right
5) multi-sites won't have too much hostnames, it should be a select
6) users would be limited by the watchdog limit.
thanks a lot for sticking on this.
Note:
for users that might intend to test these modules, they are in acceptable condition
I encourage testing them and leave feedback
read the current TODO list at #19
PS: I'll bring another release as soon as I get ride of a couple of deadlines
Comment #25
nancydruI committed what I have, so now you can post patches in new issues. Feel free to revert the user and hostname changes.
Comment #27
arhak commentedfor the updated TODO list of these modules refer to #623740: dblog_ext/dblog_filters TODO list
Comment #28
arhak commented