khalilou88 / jnxplus

Nx plugins that adds Java/Kotlin monorepo support to Nx workspace using Gradle and Maven
MIT License
57 stars 14 forks source link

Logs not visible when running the application #909

Open sw-tracker opened 4 months ago

sw-tracker commented 4 months ago

Hi there,

I have the following under targets:

"serve": {
      "dependsOn": ["maven-serve"]
    },
    "maven-serve": {
      "options": {
        "task": "spring-boot:run -Dspring-boot.run.arguments=\"--spring.profiles.active=local\""
      }
    },

When I run my application on its own, the logs are shown on the console:

nx run my-app:serve

But when I run multiple apps, I cannot see the logs from multiple apps:

nx run-many --parallel=8 --verbose=true --target=serve

How can I see the logs from all spring boot applications?

khalilou88 commented 4 months ago

Hi @sw-tracker Thanks for raising this issue. I will try to reproduce this bug with this repo : https://github.com/khalilou88/jnxplus-examples I don't know how to solve it but thinking about changing execSync by spawnsync

sw-tracker commented 4 months ago

Thanks @khalilou88 . I was thinking that it would be cool if each app showed a prefix in each of the logs, that way when multiple apps run in parallel we can identify to which app the log belongs to. Something similar to the way concurrently does it.

Here is a small example of how 4 apps running in parallel using concurrently look like: image

Let me know if you need any help reproducing the issue.

sw-tracker commented 1 month ago

Hi @khalilou88 ,

In our pipelines, it would suffice being able to forward all the logs to a file that we can view when evaluating pipeline errors.

khalilou88 commented 4 weeks ago

@sw-tracker You are asking for nice features, but I don't know how to make them and also don't have much time. I will accept new PR for that. A new executor in experimental mode will be good, then merge it with the run-task executor later.