Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs not visible when running the application #909

Open
sw-tracker opened this issue Mar 1, 2024 · 5 comments
Open

Logs not visible when running the application #909

sw-tracker opened this issue Mar 1, 2024 · 5 comments

Comments

@sw-tracker
Copy link

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
Copy link
Owner

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
Copy link
Author

sw-tracker commented Mar 2, 2024

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.

@khalilou88 khalilou88 added the help wanted Extra attention is needed label Apr 11, 2024
@sw-tracker
Copy link
Author

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
Copy link
Owner

@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.

@khalilou88
Copy link
Owner

@sw-tracker, this feature is already in nx with --output-style=stream option:
nx run-many --parallel=8 --verbose=true --target=serve --output-style=stream

@khalilou88 khalilou88 removed the help wanted Extra attention is needed label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants