Search code examples
dreamfactory

Dreamfactory - Why is my server event script not called?


I have a bitnami instance that I use to run DF 2.12.0, on which I added a custom “Remote service” (a HTTP REST API). I would like to use server-side event scripting functionalities to pre-process request data before sending it. I have this pre-processing Node js test script, that is linked to the “pre_process” event of my resource :

console.log("test");

But it seems that this script is not executed, after having a look at the DF log file :

Log file - 1

However, all DF built-in functionalities such as the user management service seem to work with event scripting. Here is the same log file about a script linked to the user.session.get.pre_process event, that is indeed called :

Log file - 2

Strangely, the complete path of my main event script is netwrixapi.search.post.pre_process, but the first log file image only mentions a call to the event “netwrixapi.post.pre_process” (without my resource “search”). I included the “X-DreamFactory-Api-Key” in my request header, which references an app with a full-access role to API and script sources for all HTTP methods :

Role

I also set APP_DEBUG=true and APP_LOG_LEVEL=debug in my .env file, without any luck. Any ideas ?


Solution

  • Problem finally solved : seems like the log_events variable wasn't set to true by default (even if the official documentation says so) in my {$HOME}/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/config/df.php file.