Logging ability for Scheduled Tasks

5 views
Skip to first unread message

Dmitry A.

unread,
Jul 23, 2012, 1:09:39 AM7/23/12
to in-por...@googlegroups.com
Hi everyone,


Recently we have added lots of nice features/improvements to Scheduled tasks. As we start using Scheduled Tasks in real live projects I can foresee the need of ability to Save to the Log if necessary. 

Let's say we have a some report stored at the end when Task is complete or/and while it's still running. This means that actual reporting part is a custom thing that can be programmed within a Task since not every task need it at all, but we need to provide good tools and programming interface for it.

Some of the requirements might be:

1. the ability to keep individual Reports for each task (time stamped), plus ability to have anything you want need to saved within that report.
2. report rotation - can be similar to Email Log


Let me know what you think on this.


DA

Phil

unread,
Jul 23, 2012, 4:05:26 AM7/23/12
to in-por...@googlegroups.com
Hi Dmitry,

I'm for individual reports + log rotation. May we could also bring log rotation to all logs (in Logs category), I have experience of users who have million of entries on their logs, and nobody cares about it. Of course we'd need with a special system for Visitors log, which handle part of Affiliate informations.

p


Envoyé avec Sparrow

Alexander Obuhovich

unread,
Jul 23, 2012, 6:54:26 AM7/23/12
to in-por...@googlegroups.com
As from implementation view point it's absolutely clear that simple textarea on scheduled task editing page won't be able to do a log rotation and such stuff. This way we need a separate database table for that.

After thinking more about it it could be a great feature to allow logging data from any event, that requires it, not just an event triggered by scheduled task. For example if we have a custom code, that sends tweet about created link and it fails it then no way to show error (since it happens on editing popup close) and it writes error to a log, where everybody can see it.

Table could have "EventLogs" name and consists of following fields:
  • LogId
  • EventName (e.g. "ls:OnSubmitListing")
  • LogDate (timestamp)
  • LogMessage (text)
At any time we can easily pinpoint actual scheduled task (if any was involved) by matching EventName to one, that is specified in scheduled task definition.


Doesn't this look too familiar with "Remote Logging" discussion (https://groups.google.com/d/topic/in-portal-dev/-YLc3RLkEtc/discussion)? Basically all logs about in-portal actions goes to that section where you can easily (far more easier, then scan large text files) process and rotate them all. Then all (or several) logs are pushed into the cloud (e.g. to in-portal.com website) where support team can help customers to analyze them right away.

Dmitry A.

unread,
Sep 16, 2012, 1:17:45 AM9/16/12
to in-por...@googlegroups.com
I think we still can have 2 new fields + functionality added to Scheduled Tasks which will simply record last Results/message (if any) of completed Job.

While we have/going to have the whole System log with rotations and other features - we still might need a simple way of storing last result of running Scheduled task if you will - it's not related to System Log - it's a results of the task.


DA

Alexander Obuhovich

unread,
Sep 16, 2012, 7:29:48 AM9/16/12
to in-por...@googlegroups.com
We can't fit it into 2 fields. I think a scheduled task itself will call $this->Application->log(....) method and that's all.

He can't have 2 logs. One for ScheduledTasks table and other for SystemLog table.

Dmitry A.

unread,
Sep 16, 2012, 1:35:05 PM9/16/12
to in-por...@googlegroups.com
Thanks for pointing out - agreed on your proposition.

Would you please create a task for this?

DA

Alexander Obuhovich

unread,
Sep 16, 2012, 1:41:57 PM9/16/12
to in-por...@googlegroups.com
I can't.

First we need to list all existing scheduled tasks and agree on what info should be added to log and when.
If some info will be logged for each scheduled task, then we also need to agree on it.
Reply all
Reply to author
Forward
0 new messages