Answer the question
In order to leave comments, you need to log in
How to monitor the logs of a running program in the console?
I run the program in the console:
./programma &
the & symbol says to run it in the background. But at the same time, I see logs from it in the console.
If I close the console and open it again, I will no longer see these logs.
Q: How do I get hooked on the program and watch them again ?
Answer the question
In order to leave comments, you need to log in
1. Use nohup - then the program will not only run in the background, but also get rid of your console, and the logs will automatically go to the nohup.out file
nohup ./programma &
2. Run the program in the background with output redirection
./programma >programma.log 2>programma_errors.log &
nohup ./programma >programma.log 2>programma_errors.log &
nohup ./programma >programma.log 2>&1 &
Write a service config for systemd and run your chat as a service through standard OS mechanisms. Logs will be written to a file in /var/log. Logging can be configured so that there is a separate file for your application.
Systemd service configs in Ubuntu are located in /lib/systemd/system files with .service extension. You can take one as an example.
https://wiki.archlinux.org/index.php/GNU_Screen_(P...
https://wiki.archlinux.org/index.php/Tmux
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question