How to redirect the stdout and stderr in rolling file with Unix redirection

前端 未结 2 568
孤独总比滥情好
孤独总比滥情好 2021-01-19 00:12

I have java application which I am running on Unix from the command prompt. I am redirecting stdout and stderr to console.out and console.err files

2条回答
  •  天命终不由人
    2021-01-19 00:55

    Or you can use rotatelogs

    nohup java MyAppName 2>&1 | rotatelogs -l Console_%Y-%m-%d.log 86400 &

    This will create a new file with today's date every day

提交回复
热议问题