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

Add logs subcommand for mgrctl to better follow logs inside container #398

Open
bjin01 opened this issue Jul 11, 2024 · 2 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@bjin01
Copy link

bjin01 commented Jul 11, 2024

It would be great if a subcommand e.g. logs could be added so user can use mgrctl logs to directly monitor logs inside containers.

mgrctl logs --taskomatic -f
mgrctl logs --web -f
mgrctl logs --reposync -f
mgrctl logs --salt -f

-f should stand for "--follow"
It is quite inconvenient to type out the long directory path inside container e.g.

mgrctl exec "tail -f /var/log/rhn/reposync/*.log"
mgrctl exec "tail -f /var/log/rhn/rhn_tasko*.log"
mgrctl exec "tail -f /var/log/rhn/rhn_web*.log"
mgrctl exec "tail -f /var/log/salt/{api,master,minion}"

THANKS

@cbosdo cbosdo changed the title enhancement: Add logs subcommand for mgrctl to better follow logs inside container Add logs subcommand for mgrctl to better follow logs inside container Jul 11, 2024
@cbosdo cbosdo added enhancement New feature or request good first issue Good for newcomers labels Jul 11, 2024
@cbosdo
Copy link
Contributor

cbosdo commented Jul 11, 2024

I wonder if we should have parameters for each log file or subcommands: mgrctl logs --taskomatic vs mgrctl logs taskomatic... The advantage of parameters is that this leaves the door opened to getting the logs of multiple files at a time. I don't know how easy to implement that would be though.

@bjin01
Copy link
Author

bjin01 commented Jul 12, 2024

I think for taskomatic, salt and rhn_web* log files it is ok just to have a parameter:

mgrctl logs --taskomatic -f
mgrctl logs --web -f
mgrctl logs --salt -f

because the number of log files is quite low.

OK, we also have tomcat logs.

apache and postgres logs are pushed to journald.

But for reposync logs in /var/log/rhn/reposync/.log it would be good to let user specify a regex input. e.g.
mgrctl logs --reposync --files "^opensuse.
" -f

I suppose the log directory paths are static or can be overriden by runtime env on the host.

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

No branches or pull requests

2 participants