java 启动jar包 借助 cronolog来分隔日志


安装cronolog

Mac

brew install cronolog

Linux

  1. Download (the latest version )
    wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
  2. Unzip
    tar zxvf cronolog-1.6.2.tar.gz
  3. Enter the directory where the cronolog installation file is located
    cd cronolog-1.6.2
  4. Run and install
    ./configure
    make
    make install
  5. Check the directory where cronolog is installed (verify whether the installation is successful)
    which cronolog
    Under normal circumstances, it is displayed as: /usr/local/sbin/cronolog

参考:https://blog.katastros.com/a?ID=00850-24925358-9bb7-462e-bfce-628b2eea1566

启动 jar 包

nohup java -jar common-api.jar | /usr/local/cronolog/sbin/cronolog logs/console-%Y-%m-%d.out &

nohup java -jar bop-data-1.0-SNAPSHOT.jar | /usr/local/cronolog/sbin/cronolog /root/logs/%Y-%m-%d-bop-data.log &

原创文章,作者:1402239773,如若转载,请注明出处:https://blog.ytso.com/tech/java/272675.html

(0)
上一篇 2022年7月9日 08:47
下一篇 2022年7月9日 08:47

相关推荐

发表回复

登录后才能评论