代码之家  ›  专栏  ›  技术社区  ›  Chloe

在命令行中,如何在与当前应用程序不同的应用程序中获取弹性Beanstalk环境的日志?

  •  0
  • Chloe  · 技术社区  · 6 年前

    我想为另一个应用程序获取日志。我想买点像

    eb --app other-app staging-environment
    

    它已经允许您选择环境。 eb logs --help 没有显示任何相关信息。或者我希望

    aws elasticbeanstalk logs --app other-app --env staging
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Kevin S Lin    6 年前

    弹性Beanstalk并不真正适合在应用程序之间切换,因为所有命令都在同一个应用程序的上下文中工作。也就是说,这是AWS,您可以让它与一些额外的bash脚本一起工作。您可以使用如下内容:

    mkdir eb-apps && cd eb-apps
    mkdir app1 app2 app3
    cd app1 && eb init # configure your app
    cd app2 && eb init
    ...
    
    function getLogs() {
      app=$1
      pushd eb-apps/$app
      eb logs
      popd
    }