Hello,
Is there a reason why there is no system.watchdog service? I would find this very usefully and wrote a small watch_service module, but I think this sould rather go into system_service. So am I missing something?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 521346.patch | 2.61 KB | gdd |
| #5 | 521346.patch | 3.17 KB | gdd |
| #2 | system_service.module.patch | 2.33 KB | Ghostthinker |
Comments
Comment #1
marcingy commentedIf you provide a patch agaist system_service will review it and hopefully add it to the available services - as being part of the system services makes a lot of sense.
Comment #2
Ghostthinker commentedHere is the patch. The question is - how safe is this method. I guess watchdog $message is a powerfull function with no user input checking. I guess it would be better (for me) to keep it a extra module which could be "log_service" and make some custom (safe input) services.
So what do you think about it? Evil patch?
Btw, I'm using logging for real-time flash remote performance and usability tests, if anybody is interested. say hallo.
Comment #3
gddAt the very least you should be checking those inputs, yes. At first I wasn't sold on this patch but I might be warming up to it. For remote logging of events from Flash apps it could certainly be useful. I'll give it some thought.
Comment #4
Ghostthinker commentedJust a little update on flash logging. When I start my App, I create a Logger class that records everything of importance (mousemovemnet, fps changes, clicks and some variables to watch). On drupal, I store this information with a node type "flash log". When the user leaves the page (javascript event), I call the "sendFlashLog" message. This works very well and is better than using the overfilled watchdog. For example:
I collect the information of significant changes in framerate, so every time the fps changes > 5 I store the (time=>fps) pair in an array. When the performance log is submitted, I convert this data into json (I am using an adapter pattern) and on drupal site i wrote a formatter that displays the json data in a fancy flash graph (don't know the name of the graph atm, but googlebing will help).
Maybe this information is usefull for someone.
Btw:
For "on site" flash "debugging", I use ExternalInterface.call("console.log",message) n my custom trace function -> prints flash/flex traces to firebug;
Comment #5
gddHere is a slightly reworked patch, i think all i did was fix a typo and clean up a couple comments. It turns out that the inputs don't need to be checked since they are run through check_plain() on output, so no big deal.
Can you test this out? If it's good I'll commit it.
Comment #6
gddAttached is the patch I committed. It differs from #5
- Severity made an int instead of a string (the severities are constants)
- Severity param was not getting passed through to the call to watchdog()
Thanks all.
Comment #7
gddAnd for anyone trying to use the previous patch, note that it is missing a hook_perm() definition for the watchdog service. This was corrected here:
http://drupal.org/cvs?commit=304370
The service will not work without this change.