Redirect a Service Output to a File
Introduction
It can be useful to redirect a program's output to a file. Here's how to do it.
Usage
This command uses the GDB debugger to attach to a running process and reassign the file handle to a file.
The two commands executed in GDB are:
and
which creates a file and opens it for output to which the process will be assigned.
Sequentially, this command closes the STDOUT file handle, creates a new output file, and captures the output to this file.