Closed (won't fix)
Project:
Troll
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Dec 2009 at 21:07 UTC
Updated:
16 Dec 2015 at 14:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
deekayen commentedSo it is blocking but not logging or did you only see if it was logging?
That feature wouldn't have been removed on purpose.
Comment #2
MrGeek commentedIt's blocking fine, but no logging. I've removed/uninstalled and re-installed and i still see no logging.
Comment #3
MrGeek commentedi have done a fresh install of Troll on another D6 site and confirmed that when an IP is blocked, nothing is logged - isnt anyone else seeing this?
Comment #4
MrGeek commentedAnyone? anyone?
Am i the only one seeing this?
Comment #5
ilo commentedFrom what I've seen.. Inside the hook_boot() implementation:
According to the troll.module code, the watchdog message should only appear if the domain is not FALSE.
According to troll.install code, domain_name in {troll_ip_ban} is 'not null' => TRUE, 'default' => '' <- empty string.
When submitting the Ban IP form, the value for domain_name is, even if empty, '' <- empty string.
So the only reasons to not watchdog the message are:
- IP address in not banned, it is possible because this code is out of the if (troll_is_backlisted()) conditional logic.
- The Ban has expired, and therefore the query founds no entry.
So just watching the code, if you get the blocked.html page, than for sure the watchdog() call has been executed, because if $domain is false, the IP address is not banned.
But, just to confirm, the only reason why watchdogs are not logging is because it is the hook_boot() implementation, if this message is not being logged, then ANY of the messages are being logged. May that be true?
The place to call the hook hook_boot() during bootstrap is at _drupal_bootstrap() in bootstrap.inc
The modules are loaded and then the hook_boot is called. The order of loading is based in the arguments used to call module_list(), the first TRUE is to refresh a previously saved list, and the second argument (bootstrap) is to load only those modules marked to be loaded during bootstrap (caching and alike modules):
Troll is in that list, but dblog (aka, database logging) is not included in this list. I guess we can say, any logging is being done currently during the hook_boot() implementation. Even including the module in the bootstrap list, it would require an equal or lower weight than troll module to be working.
I've spotted several solutions here, but I don't feel comfortable with any of them. it is possible to load dblog module in troll_boot() (drupal_load('module', 'dblog') and that would do, but there is to check the module is already enabled, and this doesn't cover syslog, and other logging modules. It can also be fixed setting the messages during hook_boot, and logging them later during hook_init().
I want to confirm: it is not logging anything during hook_boot, and this includes the following messages:
I've included the testcase for this issue, it tests very basically the blocking functionality, and does also changing bootstrap flag for dblog module.
Comment #6
francewhoaConfirming that blocked IPs are not logged into watchdog at admin/reports/dblog This is with Troll 6.x-1.x-dev (2009-Aug-03). I haven't tried patch in comment #5. I didn't notice that Troll 5.x was logging the blocked IPs into watchdog.
Steps to reproduce this issue with 6.x-1.x-dev (2009-Aug-03).
1. Ban an IP address.
2. Using above banned IP address try to access the site.
3. The IP ban works. Banned IP can't access the site.
4. The IP address isn't log into watchdog at admin/reports/dblog though. Expected result is that the access attempts done by the banned IP address should be log into watchdog at admin/reports/dblog.
If someone else want to contribute testing here is an easy way to test a banned IP.
1. Go to admin/user/troll/ip_ban and ban the IP Address
85.214.74.70Domain Namehttp://ipinfo.info2. Go to http://ipinfo.info/netrenderer/index.php and type in your site URL into the field at the top of this page. Click on RENDER button.
3. If successful the Troll banned page (blocked.html) will be display down this page.
4. Go to watchdog at admin/reports/dblog to check if the above access attempt has been log.
Comment #7
jhedstromI created this issue specific to the watchdog message on blocking a user (not when a blocked ip or user attempts access): #749924: Add watchdog record when a user is blocked
Comment #8
MrGeek commentedAre the changes mentioned in #7 implemented in the latest release?
Comment #9
drewish commentedMarked #541936: Blocked events are not registered in dblog as a duplicate.
Comment #10
mgiffordIf this is still an issue, please re-open and upgrade version to D7. Drupal 6 is no longer being maintained.