Closed (won't fix)
Project:
Drupal core
Version:
8.4.x-dev
Component:
dblog.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Sep 2009 at 10:37 UTC
Updated:
6 Feb 2017 at 17:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
arhak commentedthe demo module attached above (
dblog_time_filters) addresses time filteringnot same but similar to what requests #251814: Add time based filter on watchdog overview page
this patch will facilitate implementations of any filter for log entries
Comment #2
arhak commentedalso available for D6 #582672: dblog support filters through a hook (6.x)
Comment #4
arhak commentedrerolled with webchick's changes
Comment #5
arhak commentedComment #6
nancydrusubscribing
Comment #7
arhak commentedComment #8
arhak commentedI have already implemented a few log filters by means of custom modules taking advantage of this patch to dblog
having dblog to invoke hooks allows to provide filters (which might be enabled/disabled at will)
- filter by username (with autocompletion)
- filter by hostname
- filter by recent (configurable recent times)
- filter by aged (ditto)
- filber by date & time around +/- X time (not yet implemented)
the attached image shows two new filters taking advantage of hooks provided by this patch
Note: the UI changes are NOT part of this patch, this patch ONLY provides hooks for dblog module to look for the enabled filters
Comment #9
arhak commentedfor those reviewing usability
screenshots are available showing what modules would be able to provide through these hooks on dblog
taking advantage of log_filter hook
Comment #10
Bojhan commentedwow, what the hell. I would love to review usability, but I think its best if you first take a shot at it yourself. Obviously having 4 large select lists, totally collapsed with actions floating beside them is not the best way to go. Consider the use case, which ones do you use the most? And how can you align them all so that they make sense, perhaps you need to collapse them.
Comment #11
Bojhan commentedAlso, we are introducing new functionality here - that I am questioning, perhaps someone else could review its importance.
Comment #12
dries commentedI'm not in need of 'Aged' and 'Recent' filters, but boy, I'd love 'Username', 'Hostname' and 'Description' filters in core.
Comment #13
dries commentedCross-posted with Bojhan.
Comment #14
nancydruDries: +1 on username. This is one of the things I suggested in the Util issue that sparked this. And I think if you had "Aged" you might actually use them once in a while, especially if you used Util's log_clear add-on, which allows selective clearing of log entries.
Hierarchical select somehow adds a resizing "grippie" to its select lists, perhaps that would be a good idea here to minimize the "clutter".
Comment #15
nancydruI have tried this and everything looks good, except I'd like a tiny bit of space between the selection boxes, but that should not hold this up. IMO, RTBC.
BTW, Dries, here's your user filter:
If you'd prefer it as a patch to the user.module, I can handle that.
BTW, also see #583632: Clear log description needs clarification
Comment #16
arhak commented@#10 please consider that this patch just "opens" the possibility to other modules to do this,
the actual filters are (by now) provided by modules out of dblog
therefore, how things gets laying out, or how it is styled was not addressed
if would be a "need" to have other filters, the first thing to do is to allow them with a hook, right?
do you think some of the filters in the screenshot should be in dblog from the beginning?
it can be done, but I recommend to keep "type" and "severity" being mandatory filters
and being available to get ride of any/every remaining filter (except for type & severity)
EDIT: typos
Comment #17
nancydru@arhak: I'm thinking that perhaps the dblog module should come with an "extra filters" module that provides the add-ons, and maybe with a UI to select which ones to enable. But that may be asking too much for 7.x at this late date; we can always include that in the Util module (or a new contrib) until 8.x.
Comment #18
arhak commented@#17 totally agree BUT
wait, please, that is exactly what I would like, yes, the filters them self got too late and would be better provided by dblog_filters as already did for D6
BUT instead of requiring a whole module to replace dblog's functionality
WHAT I'm requesting and the ONLY thing this patch is asking for are the hooks to be able to do that
in this comment 578488#comment-2064964 you can see that there are several modules involved
the ONLY one I want to get into core would be dblog_ext (the one providing the hook by means of duplicating dblog functions just to put some hooks in it)
Comment #19
arhak commentedthe UI changes and the D6 modules might help deciding whether this would be a desirable issue to get into D7
BUT the actual proposed change is just: "provide hooks for filters support"
other modules will take advantage of those hooks to be the ones actually providing the filters
Comment #20
arhak commentedComment #21
arhak commentedwhy this patch to dblog?
- check the attached image for illustration
- this patch provides 2 hooks:
log_filtersandlog_filters_validate(note that both hooks are prefixed with "log" instead of "dblog" since their are applicable to logs whether or not they are for "Recent log" report)
- with this two hooks implementing new optional filters to "Recent log" report would be very easy
- as an illustrative demostration there are two working modules attached (for D7)
-- one is
dblog_filterswhich facilitates other modules to provide filters for "Recent log" report through regularlog_filterhooks, since hooking into log_filters won't make autocompletion widgets available at core for instance, so this module provides the way-- the other one is
dblog_user_filter(with autocompletion)how simple is
dblog_user_filter?as simple as the following code (is the whole module)
PS: neither of the attached modules will work properly without this patch, since
dblog_filtersrelies on itComment #22
arhak commentedfor those reviewing usability
check why_dblog_patch.png for a visual explanation
this patch does NOT provides UI changes, ONLY provides new hooks
which in turn will allow other modules to enhance log filtering
Comment #23
sinasalek commented+1 subscribed
Comment #24
arhak commentedthis one needs to be re-rolled (I'll upload it soon)
two notes:
- current patch proposes a CSS selector change for
dblog.csswhich has to be done fordblog-rtl.cssas well- currently
dblog.admin.inccontains a bug at line 279, since variable$sessiondoes not exist any more, it should be$_SESSION['dblog_overview_filter'](current patch usedTRUEuntil now)Comment #25
arhak commented- new re-rolled patch ONLY differ in having
dblog-rtl.cssmodified the same waydblog.cssgot modified-
dblog_user_filtermodule (uploaded @#21) launches some warnings (Invalid argument supplied for foreach() in theme_admin_page()) because it requires to be updated, BUT for testing purposes it works (just remember to visitadmin/config/development/logging/filtersto enable the filter after havingdblog_user_filtermodule enabled)-
dblog.css&dblog-rtl.cssare working (seeing through Firebug) but module's stylesheets are being overrided by theme'sreset.css(with or without this patch)- the above comment (@#24) about unexistent
$sessionvariable that should be$_SESSION['dblog_overview_filter']is right for the existing bug indblogmodule, but this patch initializes'collapsed' => TRUE,and latter it expands filters' fieldset if at least one filter has a saved value (code is now commented)Comment #26
arhak commentedBTW: the above comment about module's stylesheet being overrided by theme's
reset.cssis an issue of theme Seven, those CSS can be successfully tested with GarlandEDIT: leaving a reference to the Seven issue regarding this CSS problem which is more notably when testing this patch but is present with or without this patch #674208: style.css dismisses module's css
Comment #28
arhak commentedTest bed refused windows line endings.
Comment #29
arhak commentedComment #31
dave reidComment #34
arhak commentedthis patch has nothing to do with
FileFieldValidateTestCasewhich was the cause of the failing 2 tests and 14 exceptions (http://qa.drupal.org/pifr/test/23044)lets wait until that get fixed to hit the bot again
Comment #35
arhak commentedI checked the logs around the failing test (http://qa.drupal.org/pifr/log/recent) and found other 2 tests (http://qa.drupal.org/pifr/test/23068 & http://qa.drupal.org/pifr/test/23268) which also failed due to upload problems plus exceptions (while the patches are unrelated with FileField).
But it doesn't seems to be usual, since other tests got through.
So... hitting the bot again...
Comment #37
arhak commentedint opened an issue for the bot failure #667264: [TESTING BROKEN] FileFieldValidateTestCase fails randomly
EDIT: the test of this issue already passed, leaving the above reference in case it comes up again
Comment #38
nancydruDoes that mean this should be RTBC?
Comment #39
arhak commented@NancyDru
it might..
test bot is green, I tested it, you tested it, anyone else?
did Dries and/or Bojhan test it?
Comment #40
arhak commentedcomment #25 and more specifically #26 mention a CSS bug with Seven but not with Garland
the actual problem is within this patch:
dblog.css&dblog-rtl.cssgot their first CSS selector modified and I missed the selector prefix#dblog-filter-formwhich is causing Seven'sstyle.cssto achieve a narrower selector by means ofdiv.form-item(which shouldn't happen with this patch)Nevertheless, that's a minor flaw I will fix soon, the patch still needs review (which can be happily achieved with Garland)
Comment #41
arhak commented@#40 NOT this patch's fault
the existing selectors are not working with Seven, which is getting a narrower selector with
div.form-item, so currentlydblogmodule has this error when using Seven and I shouldn't mix that fix within this patchwhat would need consideration is using
.form-type-selector.form-itemI used the most specific following what was already there for
-typeand-severitybut probably
#dblog-filter-form .form-itemwould fit betterNote: for this to be appreciated in Seven (with or without this patch) the first selector in
dblog.css&dblog-rtl.csshas to be preceded by#dblog-filter-form(with a space before.form-*)EDIT: typo fix
Comment #42
arhak commentedfollow up:
the issues discovered while testing this patch (mentioned at #24, #25, #40, #41) got their separated issues (which if get fixed will require a re-roll of this one)
#674352: variable $session does not exist any more
#674354: CSS selectors get overridden by narrower selector at style.css when using Seven
Comment #43
Everett Zufelt commentedCorrecting tags
Comment #44
mgifford#28: 2009-12-15_dblog_log_filters_hook04unix.patch queued for re-testing.
Comment #46
arhak commentedrerolled same patch as #28
BUT with no CSS support for potential new filters (that would be another issue)
Comment #47
arhak commented@#12 description wouldn't be a possible filter as long as watchdog saves pairs of
'message', $argsfor on-display-time translation (can't evaluate every translatable string on the fly for the current language to make a selection of them)there are also the already translated logs which got pairs of
t('message'), NULLthat can be selected in the table, but they might be in several languages depending of the current language at the time they got into watchdogI guarantee a new project dblog_filters taking care of username/hostname once this patch gets in (otherwise it would be the madness of reproducing dblog.admin.inc in a dblog_ext module, as done in util-6.x-3.x)
so it would be available for future core inclusion consideration (if it proves its worth)
Comment #48
arhak commentedI was reviewing this patch one more time, and found a couple of bothering unclearness
- now using 'multiple' (instead of odd 'conjunction')
- less modified code, aiming to be loyal to legacy code (works exactly the same though)
Comment #49
arhak commentedattached modules for testing this patch
please, use one at the time to avoid overloaded filters form
plus the username autocompletion is lacking some CSS for better fitness
also attached a CSS patch to make all select list properly float left
(which on the side solves #674354)
Note that the CSS patch was renamed as being for D6 to avoid test bot
since it is ONLY intended to be used for testing the patch of this issue with a more confortable CSS layout
Log time filters (dblog_time_filters):
- relies on hook_log_filters
- exposes recent/aged filters
- dependencies[] = dblog
- not relying on dblog_filters' API
Log filters (dblog_filters)
- relies on hook_log_filters
- provides an API easing custom filter implementations
- dependencies[] = dblog
Log hostname filter (dblog_host_filter)
- exposes hostname/IP filter
- dependencies[] = dblog_filters
Log user filter (dblog_user_filter)
- exposes username filter
- dependencies[] = dblog_filters
Comment #50
arhak commentedscreenshots (modules with CSS patch at #49 for testing)
the actual patch of this issue is at #48
Comment #51
arhak commentedComment #52
retester2010 commentedtrailing white space
Powered by Dreditor.
Comment #53
mgifford@retester2010 is this against patch #48
Think it's ready for RTBC after that space is removed?? I can re-roll this if it helps move things ahead.
Comment #54
mgifford#48: 2010-03-10_582622_dblog_log_filters_hook06unix.patch queued for re-testing.
Comment #56
dave reidBumping to D8. It's too late for an API change.
Comment #57
arhak commentedComment #58
klonossubscribing...
Comment #59
Bojhan commentedWhoa, this is quite messy - what are we doing here?
Comment #60
Nahbyr commentedJust out of curiosity, is this still being developed or already finished?
This would be a handy feature.
If it's already finished then thanks to whoever made this! If not then I'll probably have a go at it myself.
EDIT: Just to clarify, I meant the Drupal 8 bit.
Comment #61
arhak commented@Nahbyr#60
AFAIK this issue is unattended
with all due respect, Bojhan (@#10 & @#59) keeps wondering what this is about, despite my attempts to make it the most self-explanatory as possible
this is a request to introduce a harmless hook, in order to allow contrib to extend dblog's filters functionality
http://drupal.org/files/issues/why_dblog_patch.png
Comment #62
mgifford@arhak Are you willing to subit this as a patch to D8?
Comment #64
cilefen commentedThis is a miscategorized feature request.
Comment #67
dagmarNow that #2015149: Replace dblog recent log entries with a view finally landed this issue can be closed. In my opinion adding hooks to alter the dblog_filters never was a viable alternative because you have to alter a lot of other parts of the dblog module to make this work.