Child pages
  • [system log, scheduled tasks] Logging ability for Scheduled Tasks
Skip to end of metadata
Go to start of metadata

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/5b7caca650487edd#

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.

6 Comments

  1. 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

  2. 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.

  3. 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

  4. 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.

  5. Thanks for pointing out - agreed on your proposition.

    Would you please create a task for this?

    DA

  6. 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.