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

allow customising global process compose log file #70

Closed
adrian-gierakowski opened this issue Jul 19, 2023 · 2 comments
Closed

allow customising global process compose log file #70

adrian-gierakowski opened this issue Jul 19, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@adrian-gierakowski
Copy link
Contributor

Feature Request

I'd like to be able run multiple instances of pc concurrently and have each use a distinct log file for process-compose logs. Currently all instances share the same file (/tmp/process-compose-$USER.log), which causes the file to be truncated each time a new instance starts, and makes it difficult to debug individual pc instances.

example result of failing to log file while 2 instances are started:

> tail -f /tmp/process-compose-$USER.log
23-07-19 11:39:37.693 INF Process Compose v0.51.4
23-07-19 11:39:37.693 INF Global shell command: bash -c
23-07-19 11:39:37.693 INF Loaded project from /home/adrian/code/rhinofi/rhino-core/process-compose.yaml
23-07-19 11:39:37.693 INF start http server listening :8080
23-07-19 11:39:37.693 DBG Spinning up 1 processes. Order: ["log-test"]
23-07-19 11:39:37.694 INF log-test started
tail: /tmp/process-compose-adrian.log: file truncated
23-07-19 11:39:42.180 INF Process Compose v0.51.4
23-07-19 11:39:42.180 INF Global shell command: bash -c
23-07-19 11:39:42.181 INF Loaded project from /home/adrian/code/rhinofi/rhino-core/process-compose.yaml
23-07-19 11:39:42.181 INF start http server listening :8080
23-07-19 11:39:42.181 DBG Spinning up 1 processes. Order: ["log-test"]
23-07-19 11:39:42.181 INF log-test started
23-07-19 11:39:46.085 INF log-test exited with status -1
23-07-19 11:39:46.085 INF Project completed
23-07-19 11:39:46.085 DBG process log-test is in state Completed not shutting down
23-07-19 11:39:47.086 INF Thank you for using process-compose
23-07-19 11:39:47.147 INF log-test exited with status -1
23-07-19 11:39:47.147 INF Project completed
23-07-19 11:39:48.148 INF Thank you for using process-compose

Use Case:

running multiple instances of pc concurrently

Proposed Change:

Add a way to configure the log files location.

Who Benefits From The Change(s)?

Anyone who wants to run multiple instances of pc concurrently

Alternative Approaches

Each instance could be given a name and then the name could be prepended to each log line in shared file. By default, port could be used instead of a name (if not given), since that should be unique per instance. In this case, it would be good to be able to disable truncation of the log file on startup.

Another option could be to add PC_LOG_POSTFIX env var and use it (if defined) instead of USER for the log location.

@F1bonacc1 F1bonacc1 added the enhancement New feature or request label Jul 19, 2023
@F1bonacc1
Copy link
Owner

Will be added in the next release.

@F1bonacc1
Copy link
Owner

Added in v0.60.0
Feel free to reopen if it doesn't work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants