I'm running a parity supernode, recently switched from geth because parity seems to perform much better, even in archive
mode.
To log the standard output of geth, I used to run:
geth [options] console 2>>/tmp/geth.log
I tried to run similar command for parity, but it wont log the standard out.
~ $ parity --help | grep -A1 log
-l --logging LOGGING Specify the logging level. Must conform to the same
format as RUST_LOG.
Natively, parity allows to set a logging level. But how can I make parity actually write logs?
Best Answer
Send Stderr And Stdout To A Log File
If you want to overwrite the log file each time you start your command:
If you want to append to your log file each time you start your command:
Send Stderr And Stdout To Separate Log Files While Viewing Output
And if you want to log stderr and stdout into separate log files while viewing the output on your console:
Reference How do I write stderr to a file while using “tee” with a pipe?.
If you want to create a script file to run this command, you will have to use
#!/bin/bash
(instead of#!/bin/sh
) in the first line of the file as this redirection is bash specific:Save the above into
$HOME/bin/runParity
,chmod 700 $HOME/bin/runParity
and your can then typerunParity
(or$HOME/bin/runParity
) to start it.