How to select which service to get logs from in the CLI?

Hello. I tried to use the CLI to get logs from one of the services in my project, but sadly the CLI was showing me the logs of another service. Cheking all the options of the CLI doesn't seem possible to target specific services or get all the logs, it seems to focus on the latest service that was built. Is this a limitation?
Solution:
GitHub
Fix railway logs pulling from the wrong deployment by Milo123459 ...
This fixes #436 This also fixes this for linked environments This also makes sure it pulls from the latest active deployment, not just the latest deployment
Jump to solution
10 Replies
Percy
Percy9mo ago
Project ID: N/A
danielo515
danielo5159mo ago
N/A
Brody
Brody9mo ago
oh yeah that is broken, seems like the cli picks a service from the project alphanumerically and displays it's logs instead of the linked service
danielo515
danielo5159mo ago
what is a "linked service" ? the CLI doesn't allow me to pick any service when linking
Brody
Brody9mo ago
yes it does, you run railway service but that still doesn't print the logs from the linked service, this is a bug
angelo
angelo9mo ago
@Brody - we are talking quite a bit about CLI dev, can you raise an issue on the repo? I will raise internally.
Brody
Brody9mo ago
I have a feeling either me or jr already created an issue on the repo for this indeed, jr has opened an issue https://github.com/railwayapp/cli/issues/436
danielo515
danielo5159mo ago
So linking is not done by railway link?
Brody
Brody9mo ago
from railway help
link Associate existing project with current directory, may specify projectId as an argument
service Link a service to the current project
link Associate existing project with current directory, may specify projectId as an argument
service Link a service to the current project
milo and I have been working on a fix for this and things are looking good so far, we are just pending on more tests
Solution
milo
milo9mo ago
GitHub
Fix railway logs pulling from the wrong deployment by Milo123459 ...
This fixes #436 This also fixes this for linked environments This also makes sure it pulls from the latest active deployment, not just the latest deployment