title: How to create that logger for Django?
body: <pre><code>URL: / client /[client_id]/ log / operator
  Method: POST
  Data:
  {
  "access_token": "TOKEN",
  "limit": 100,
  "sort": "asc",
  "start_date": "2018-01-01T00: 00: 00Z"
  }
  OR
  {
  "access_token": "TOKEN",
  "limit": 100,
  "sort": "asc",
  "offset": "500"
  }
  
  Success Response:
  {
  "result": "ok",
  "logs": [
  {
  "date": "2018-01-01T00: 00: 00Z",
  "text": "Log entry"
  },
  ...
  ]
  }
  </code></pre>
  
  <p>Log entry in the format: "message. User: name the name of the operator."</p>
  
  <p>I need to create a request to receive logs of operator activity. Which returns a formatted log of all user actions.</p>
  
  <p>I have an activity application in which there is an OperatorLog model.</p>
  
  <pre><code>from django.db import models
  
  from users.models import User
  from .constants import ACTIVITY_ACTIONS
  
  
  class OperatorLogManager(models.Manager):
      """Manager for operator logs"""
  
      def active(self):
          """Mark object as active"""
          return self.filter(is_delete=False)
  
      def get_by_user_id(self, id):
          return self.active().filter(pk=id)
  
      def get_by_client_id(self, client_uid):
          return self.active().filter(client_uid=client_uid)
  
  
  
      class OperatorLog(models.Model):
          """Model for logs"""
  
          user        = models.ForeignKey(User, on_delete=models.CASCADE)
          created     = models.DateTimeField(auto_now_add=True)
          is_deleted  = models.BooleanField(default=False)
          action_type = models.CharField(max_length=32,
               сhoices=ACTIVITY_ACTIONS)
          message     = models.TextField(max_length=2048)
          client_uid  = models.CharField(max_length=50)
          bitrix_id   = models.PositiveIntegerField()
  
          # Operator Manager
          objects = OperatorLogManager()
  
          def delete(self, **kwargs):
              self.is_deleted = True
              self.save()
  </code></pre>
  
  <p>You need a public api (activity / api.py) to register events in other applications,
  There is also a file with a list of activity types (constants.py), it should be available in other applications via the import of api.py, you need to output the logs using the serializer (DRF).</p>
  
  <p>constants.py (Sample version)</p>
  
  <pre><code>from model_utils import Choices
  
  ACTIVITY_ACTIONS = Choices (
     ('ACTION_REQ_PHONE_VERIFY', 'Request phone verification'),
     ('VALIDATE_PHONE', 'Request phone validation'),
     ('VALIDATE_EMAIL', 'Email validation'),
     ('SET_INTERNAL_VERIFY', 'Set result of Internal verification'),
     ('SET_BANK_VERIFY', 'Set result of Bank verification'),
     ('GET_CLIENT_DATA', 'Request client data'),
     ('GET_SENSITIVE_INFO', 'Request sensitive info'),
     )
  </code></pre>