问题
Upon running Screen with the -L flag, a file called 'screenlog.0' is created and all output written to it (which is great), but I will be running several Screen sessions and I need to identify the logs with a unique number. Is it possible to change the log file name?
回答1:
You can edit your .screenrc
file and add something like this:
logfile /tmp/myownlog
It is also answered at Specifying a log name for screen output without relying on .screenrc.
回答2:
Probably the easiest way is to use the following:
screen -L -Logfile log_filename your_command
回答3:
Alternatively, there's a way to do it online.
Enter command mode in screen via Ctrl+a, : and use the logfile
command with the name of the file you want as argument, eg: logfile whatevernameyoulike.log
Source: screen man page
回答4:
Use script
command inside your screen
session.
来源:https://stackoverflow.com/questions/15026184/is-it-possible-to-name-the-screen-logfile-from-the-l-flag