如何在Ubuntu中查看过程日志
我在连续运行的GCP Ubuntu验证器上启动了一个验证器。
当我使用验证器启动以下验证器时:
sudo mortar server --data-dir ./data-dir --chain genesis.json --libp2p 0.0.0.0:PORT --nat IP-ADDRESS --seal --price-limit 1 &
该过程中的所有日志都在我当前的Shell会话中输出。
但是,由于关闭并重新连接到VM,因此我无法访问日志。我尝试了Reptyr 6460
,但是获取此错误
Process 6460 (sudo) shares 6461's process group. Unable to attach.
(This most commonly means that 6461 has suprocesses).
是否有其他方法可以实时重新连接到该过程日志?
I started a validator on a GCP Ubuntu validator which runs continuously.
When I started the validator with:
sudo mortar server --data-dir ./data-dir --chain genesis.json --libp2p 0.0.0.0:PORT --nat IP-ADDRESS --seal --price-limit 1 &
all the logs from the process were outputted in my current shell session.
However since closing and reconnecting to the VM I cannot access the logs. I tried reptyr 6460
but get this error
Process 6460 (sudo) shares 6461's process group. Unable to attach.
(This most commonly means that 6461 has suprocesses).
Is there any other way to reconnect to the processes logs in real time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如Bryan L在使用屏幕的评论中建议的那样,
屏幕
dickapt install script
屏幕
现在您可以运行程序。断开和重新连接启动屏幕后,使用:
屏幕-R
As Bryan L suggested in a comment using screen did the
screen
did the trickapt install screen
screen
Now you can run your program. After disconnecting and reconnecting start screen using:
screen -r
Linux日志将使用命令CD/var/log显示。然后,您可以输入LS以查看该目录下存储的日志。查看最重要的日志之一是Syslog,该日志记录了与身份相关的消息以外的所有内容。发出命令var/log/syslog,以查看syslog下的所有内容。
所以:
Linux logs will display with the command cd/var/log. Then, you can type ls to see the logs stored under this directory. One of the most important logs to view is the syslog, which logs everything but auth-related messages. Issue the command var/log/syslog to view everything under the syslog.
so: