I want to redirect a bash script's output through a logging program. Specifically, Apache's logrotate utility. The redirection needs to be set within the script itself.
If the redirection were done on the command line, while executing the script, it would look like this:
myscript | logrotate -l $LOGFILE.%F 86400 2>&1
Here is some pseudo-code that goes inside the script to accomplish the output redirection, which does not work:
exec >(logrotate -l $LOGFILE.log.%F 86400) 2>&1