I'd like to know if someone has tried logging their gnu-screen session to a logfile (other than the default screenlog.N where N is the session number).
I tried doing the following
~$ screen -L custom_screenlog -S test_session
but screen would terminate. It's not also in the screen manual. Tried searching Google and I can't seem to see an answer.
Thanks.
You can also use Ctrl + A , H to save loggings into a screenlog. n file.
To activate the screen logging function, just press “Ctrl-A” and “H“. (Please be careful, we use capital 'H' letters. Using non-capital 'h', will only create a screenshot of the screen in another file named hardcopy).
You can find the screenlog. 0 file in screen 's current working directory (cwd). This is either the directory that was the cwd when you started screen , or it's a directory you subsequently changed to using the :chdir screen command.
Log files of current screen sessions can be started with the Ctrl+a H command, which will make a file called screenlog. X where X is the number of your screen session. A screenshot of what is currently in your screen window can be invoked with Ctrl+a h, creating a file called hardcopy.
My 4.0.2 version of GNU screen has no argument to -L
switch. The log file is systematically named screenlog.0
and created in the current directory.
Then you may simply try:
screen -L -S test_session
Edit:
you can customize your .screenrc
file, adding for instance
logfile /tmp/screenlog-%Y%m%d-%c:%s
This way log files may be stored in a predefined directory (/tmp
in this example)
and may be named after logfile opening date
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With