bouleq opened a new issue #15548:
URL: https://github.com/apache/superset/issues/15548


   Hi !
   I am currently trying to use a custom EVENT_LOGGER in superset, i added the 
code snippets from the official doc but it isn't working:
   I think the EVENT_LOGGER has changed and isn't the default DBEventLogger() 
anymore because we have some new logs on stdout, and there are no more "action 
logs" in the superset UI.
   However, my JSONStdOutEventLogger() isn't used either, i added some prints 
in the log method to see if it was even called, and it doesn't seem so.
   
   Here are the code snippets i added:
   
   ```
   event_logger.py: |-
       from superset.utils.log import AbstractEventLogger
       import json
       class JSONStdOutEventLogger(AbstractEventLogger):
           def log(self, user_id, action, *args, **kwargs):
             records = kwargs.get('records', list())
             dashboard_id = kwargs.get('dashboard_id')
             slice_id = kwargs.get('slice_id')
             duration_ms = kwargs.get('duration_ms')
             referrer = kwargs.get('referrer')
             print("bip boup 1")
             for record in records:
                 log = dict(
                     action=action,
                     json=record,
                     dashboard_id=dashboard_id,
                     slice_id=slice_id,
                     duration_ms=duration_ms,
                     referrer=referrer,
                     user_id=user_id
                 )
                 print(json.dumps(log))
                 print("bip boup 2")
   
   configFile: |-
   ...
     from event_logger import JSONStdOutEventLogger
     EVENT_LOGGER = JSONStdOutEventLogger()
   ```
   ### Expected results
   
   I expect the custom log method to be used (ie to see "bip boup" and "bip 
boup 2" on stdout)
   
   ### Actual results
   
   Some debug logs and logs on the requests done are on stdout (cf screenshot)
   
   #### Screenshots
   
   
![image](https://user-images.githubusercontent.com/66407062/124567069-ec166d80-de43-11eb-9ace-d5728f9065b9.png)
   
   
   ### Environment
   
   - superset version: 1.0.1
   - python version: 3.8.8
   - node.js version: 12
   
   
   I hope i'm not missing something, thank in advance for your help ! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to