Question: Hello friends I am an android developer and right now i am working on sencha touch framework on android platform to develop an app which can run on multi platform e.g android tablets and ipads.

But i have question in my mind that if i create my app on android tablet emulator according to the android tablet need(means layout configuration),will the same app work on ipad? or i have to work on simulator to make it work on ipad? Please suggest me with ur views.

Thanx in advance.

Answer: 
So, you have `UI <-> Web Services <-> DB`

Since the **web services** talk to the DB, and the web services contain the business logic (i.e. I guess you validate stuff there, create your queries and execute them), then the best place to 'log' activities is in the services themselves.

IMO, logging **PostgreSQL** transactions is a different thing. It's not the same as logging 'user activities' anymore.

**EDIT:** This still means you create DB schema for 'logs' and write them to DB.

**Second EDIT:** Catching log worthy events in the **UI** and then logging them from there might not be the best idea either. You will have to rewrite logging if you ever decide to replace the UI, or for example, write an alternate UI for, say mobile devices, or something else.
I used [django-audit-log](https://github.com/Atomidata/django-audit-log/blob/master/docs/usage.rst) and I am very satisfied.

Django-audit-log can track multiple models each in it's own additional table. All of these tables are pretty unified, so it should be fairly straightforward to create a SQL view that shows data for all models.

Here is what I've done to track a single model ("Pauza"):

```
class Pauza(models.Model):
    started      = models.TimeField(null=True, blank=False)
    ended        = models.TimeField(null=True, blank=True)
    #... more fields ...

    audit_log = AuditLog() 

```

If you want changes to show in Django Admin, you can create an [unmanaged model](https://docs.djangoproject.com/en/dev/ref/models/options/#django.db.models.Options.managed) (but this is by no means required):

```
class PauzaAction(models.Model):

    started      = models.TimeField(null=True, blank=True)
    ended        = models.TimeField(null=True, blank=True)
    #... more fields ...

    # fields added by Audit Trail:
    action_id    = models.PositiveIntegerField(primary_key=True, default=1, blank=True)
    action_user  = models.ForeignKey(User, null=True, blank=True)
    action_date  = models.DateTimeField(null=True, blank=True)
    action_type  = models.CharField(max_length=31, choices=(('I', 'create'), ('U', 'update'), ('D', 'delete'),), null=True, blank=True)
    pauza        = models.ForeignKey(Pauza, db_column='id', on_delete=models.DO_NOTHING, default=0, null=True, blank=True)

    class Meta:
        db_table = 'testapp_pauzaauditlogentry'
        managed = False
        app_label = 'testapp'

```

Table `testapp_pauzaauditlogentry` is automatically created by django-audit-log, this merely creates a model for displaying data from it. 
It may be a good idea to throw in some rude tamper protection:

```
class PauzaAction(models.Model):

    # ... all like above, plus:

    def save(self, *args, **kwargs):
        raise Exception('Permission Denied')
    def delete(self, *args, **kwargs):
        raise Exception('Permission Denied')

```

As I said, I imagine you could create a SQL view with the four `action_` fields and an additional 'action\_model' field that could contain varchar references to model itself (maybe just the original table name).