I've created and added a Drupal Textlog module for logging system events to file, as a tiny and lightweight replacement option for watchdog (dblog for Drupal 6) module. It is intended for using in situations when the site is highly loaded and even disabling DB logging activity can slightly help. I'd like to share it as seems it may be useful for someone.
I wasn't setting up an exact measurements of how much does it helps, however I definitely see that some operations are made a bit faster now as I was installing it on some relatively big sites and also set it up on http://vito.ho.ua (which was highly loaded couple of times too :) ). I'm planning to make tests and measure the difference sometime soon.
There were already two modules on Drupal.org which may (if they were developed to this stage) bring this functionality for Drupal 6 too, but unfortunately these weren't and also seems these were abandoned some time ago. These are http://drupal.org/project/log_to_file and http://drupal.org/node/64063 . Despite some issues, these seem to be good modules and it's a big pity these weren't updated. However there is at least one more module for that now :)
Here are the reasons against using these:
- For http://drupal.org/project/log_to_file:
1. It is only Drupal 5 and doesn't uses the new hook_watchdog, and seems that is the reason why it is relatively big (68 kB vs 20 kB for proposed textlog, where 14 kB is GPL license, so 54 kB vs 6 kB pure). I think that log module should be as lightweight as possible to be of some use and serve as some replacement option to the watchdog module for the highly loaded sites.
2. There are just 3 releases of the Drupal 5 version of the module at the http://drupal.org/node/220436/release , no Drupal 6 releases of the module at the http://drupal.org/project/log_to_file and there are no releases of it since July 06, 2008, so module looks to be abandoned about 2 years ago. I'm not sure if there will be Drupal 7 release of it.
- For http://drupal.org/node/64063:
1. Module settings aren't working because of error, there is "return system_settings_form('nice_menus_admin_settings', $form);" at the end of the rawlog_admin_settings() function, looks like some parts of it were copied from the nice_menus http://drupal.org/project/nice_menus module and reused.
2. Secondly, if the module settings will work, module's hook_watchdog() has old set of parameters, "rawlog_watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL)" instead of the "hook_watchdog($log_entry)" like it is at the http://api.drupal.org/api/function/hook_watchdog/6 so it isn't working too.
3. Also, file name cannot be set in the module configuration, just a file folder, the file name cannot be changed, it is set to be always 'drupal.log'.
4. File folder is called sometimes 'folder', sometimes 'directory' in the code.
5. Top comment at the module's text says "Demo of use of hook_watchdog", there is just one HEAD nightly development CVS snapshot of Drupal 5 version of the module, no releases of the Drupal 5 version of the module at the http://drupal.org/node/64063/release , no Drupal 6 releases of the module at the http://drupal.org/node/64063 and there are no releases of it since November 11, 2006, so module looks to be abandoned for about 4 years ago. I'm not sure if there will be Drupal 7 release of it.
Module can be downloaded from the http://vito.ho.ua/en/content/download .
Also is installed on http://vito.ho.ua so seems I'll see much more testing results for it soon.
At the closest perspective, I'm planning to add some email functionality and make a beta Drupal 7 version so I will be ready to make a D7 release at the day it will be released (if they already didn't made something similar at the core certainly :) ).
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | textlog.zip | 2.66 KB | vito_a |
| #1 | textlog_1_0.zip | 8.34 KB | vito_a |
Comments
Comment #1
vito_a commentedHere is the module itself.
Comment #2
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags; some volunteers will review your code, and report what needs to be changed.
As you reported, there are already modules that implement the features of your module. Why didn't you open a feature request for those features you think missing on the existing modules? Why didn't you offer to take offer a project that you think is abandoned?
Comment #3
vito_a commentedThank you for looking at it.
Also thanks in advance for anyone who will volunteer to review the code, it is relatively small as I've tried to make it as much small and fast as possible, so it shouldn't take much time. Most of the package size is a GPL license, seems it's not needed to review it, and the rest is about 5 Kb :)
I didn't opened a feature request for those features I think missing on the existing modules and I didn't offer to take offer a project that I think is abandoned because:
1. These are Drupal 5 version modules and this one is Drupal 6 where I'm using the new hook_watchdog, so it is needed not only to rewrite modules but upgrade these to D6.
2. There are already some feature requests and a critical error at the http://drupal.org/project/issues/rawlog?status=All&categories=All and http://drupal.org/project/issues/log_to_file?status=All&categories=All accordingly and seems that these still aren't fixed.
3. Also I know which features and how I need to be implemented, so I may do that myself what may probably be quicker, so I may be submitting a patch for these to be applied.
4. However for these a patch will be a whole module size as these are having a different architecture and didn't using the new hook_watchdog, so it is quicker and simpler to recreate a module then wait to apply a patch which will rewrite the whole modules.
5. Also I'm not sure if the patch of that size may be applied quickly as these modules weren't updating for 2 and 4 years accordingly.
6. For the http://drupal.org/project/log_to_file there was already a request for co-maintaining at http://drupal.org/node/228383 and seems that didn't worked as seems that there are only commits from its original creator at the http://drupal.org/node/220436/committers .
7. Also there was a good question about using a syslog module/backport for that at http://drupal.org/node/220492 and a weighty arguments against it at http://drupal.org/node/220492#comment-1759630 , so seems that a module of this type is still needed.
Comment #4
Anonymous (not verified) commentedThe license file must be removed from the archive, as you are not allowed to commit it in CVS.
Comment #5
vito_a commentedRemoved it.
Comment #6
avpadernoRemember to change status, when you upload new code.
Comment #7
vito_a commentedSorry, I'll do from now on, thank you.
Comment #8
avpadernoThe status should be changed to when there is new code that needs to be reviewed. :-)
If the status is still , nobody will know there is code to review, and your code will not get any review.
Comment #9
vito_a commentedThanks to Jennifer Hodgdon http://drupal.org/user/155601 and her reasonable arguments at the http://drupal.org/node/720630#comment-2633568 , I've reviewed the modules again and I'm still thinking that raw (text) logging module is needed despite there are both core syslog and http://drupal.org/project/logging_alerts , because of the following reasons:
1. Both core syslog and http://drupal.org/project/logging_alerts are only logging to the system log which typically resides at the /var/log/... . Users may not have access to it at different hostings and I need the small and quick module which may write to both the system log (if file exists, it can be pointed to and module will just append messages to it) and to the custom log file. Textlog does.
2. For core syslog there is no possibility to select which message levels(severity) to log. For example, I don't want to log all Notice's, I've selected to log only events with Warning severity and higher. I've added a configuration option for that to Textlog. However the http://drupal.org/project/logging_alerts has this option too, but it can't log to custom file what I need first of all.
3. I'm planning to do some email and IM integration and tagging to choose which messages to send to email and IM no matter that severity for these is lower then the border level selected at module configuration, what Dries mentioned in the http://drupal.org/node/63881#comment-407234 . I've faced the need for it and come to this idea separately, however I'm not suprised that Dries come to that idea more than 3 years ago as it is Dries :)
4. I'm also considering to offer a patch to the http://drupal.org/project/logging_alerts or core syslog.module doing the above for coming Drupal 7 release if that would be more effective. However applying a patch and especially patching core seems to be a long process, and I don't see why users who want to have the custom logging module today shouldn't have it, as I do. Also I'm not sure if that makes sense al all as http://drupal.org/project/logging_alerts , core syslog.module and my textlog one are having different purposes and I want to keep my logging module as small and quick as it is possible, for the short range of tasks, not combining it with modules having a different purpose, especially for the syslog.module as it is core, so why push them to add something to the core if we can let people choose themselves.
5. Also seems that Drupal 5 backport is still needed.
Comment #10
vito_a commentedAlso I've just asked Jake Gordon http://drupal.org/user/15674 whom I truly respect as he is a good person (despite I know him a little and I didn't meet him personally, but you can see a good man when you meet one :) and he kindly agreed to let me take his http://drupal.org/node/64063 Rawlog module and maintain it further.
Despite he has some doubt if that type of logging module is still needed for Drupal 6 as there is syslog, I'm still willing to prove that it is (can you see the previous comment please for a list of arguments).
I've added a http://drupal.org/node/725988 to the issues list on the http://drupal.org/node/64063 . Can you please tell me if there is something else that I should do?
Comment #11
avpadernoThe current maintainer has not accepted the offer to maintain his module. I am marking this as postponed until the current maintainer doesn't publicly accept the offer.
Comment #12
vito_a commentedHe did. Can you please check the http://drupal.org/node/725988#comment-2649018 when you will have some time?
Comment #13
avpadernoThank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #14
vito_a commentedThank you :-)
Comment #17
avpaderno