I am trying to integrate datadog log monitoring with strapi, logging works but the injection doesnt work

While I can’t speak for v3 nor the actual configuration of the dd-trace package. For the v4 you should be able to do something like this:

// path: `./src/index.js`

module.exports = {
  /**
   * An asynchronous register function that runs before
   * your application is initialized.
   *
   * This gives you an opportunity to extend code.
   */
  register(/*{ strapi }*/) {
    const tracer = require('dd-trace').init({
      debug: true,
      runtimeMetrics: true,
      logInjection: true
    });
  },

  /**
   * An asynchronous bootstrap function that runs before
   * your application gets started.
   *
   * This gives you an opportunity to set up your data model,
   * run jobs, or perform some special logic.
   */
  bootstrap(/*{ strapi }*/) {},
};

At least this is dumping a bunch of debug messages about it being unable to connect to 127.0.0.1:8126 so I assume there is some config you need to do to point it at DataDog