I can see the logs in the AWS Console under Codedeploy, when I select the deployment and then click choose events
, but they appear to be truncated. If I SSH into the instance, where are those codedeploy deployment logs located?
I see logs in /var/log/aws/codedeploy-agent
, but the logs there don't match what's in CodeDeploy.
I'm running on Amazon Linux.
答案 0 :(得分:6)
我已经弄清楚了。部署日志位于:
/opt/codedeploy-agent/deployment-root/deployment-logs/codedeploy-agent-deployments.log
每个部署还会保留其登录日志:
/opt/codedeploy-agent/deployment-root/88f9d1cf-4ee4-4b0c-9458-b1d41b8d4b48/d-TTUV9E8BG/logs/script.log
其中88f9d1cf-4ee4-4b0c-9458-b1d41b8d4b48/d-TTUV9E8BG
对于每个部署都不同。
在Windows上,这似乎是:
C:\ProgramData\Amazon\CodeDeploy<DEPLOYMENT-GROUP-ID><DEPLOYMENT-ID>\logs\scripts.log
答案 1 :(得分:3)
Linux部署日志(与原始答案不同):
/var/log/aws/codedeploy-agent/codedeploy-agent.log
Linux脚本日志:
/opt/codedeploy-agent/deployment-root/deployment-group-ID/deployment-ID/logs/scripts.log
https://docs.aws.amazon.com/codedeploy/latest/userguide/deployments-view-logs.html
答案 2 :(得分:2)
如果您发现了这个问题,并且正在寻找Windows日志,则它们位于
中的userdata日志旁边。C:\ProgramData\Amazon\CodeDeploy\log\
C:\ProgramData\Amazon\CodeDeploy\deployment-logs\codedeploy-agent-deployments.log
\ log \文件夹包含代理本身的日志,显示该代理正在运行并检查更新。部署日志包含部署脚本的输出,可能就是您想要的。
(programData是一个需要管理权限的隐藏文件夹)
答案 3 :(得分:1)
使用命令登录到您的ec2实例
ssh -i {KeyPair.pem-locations to keys file here} ec2-user@10.xxx.xx.xxx{your instance ip here}
转到以下位置,您将在此处找到日志
/opt/codedeploy-agent/deployment-root/deployment-logs/codedeploy-agent-deployments.log
使用命令
cat codedeploy-agent-deployments.log
如果您的ec2是linux实例,并且您正在使用linux,则可以在命令行本身中打开日志文件。 将其复制并粘贴到本地计算机中的某个位置,以便您可以更轻松地浏览日志。
`