据我所知,&在命令之后使用是为了在后台运行它.
&用法示例:tar -czf file.tar.gz dirname &
但是怎么样&&?(看看这个例子:https://serverfault.com/questions/215179/centos-100-disk-full-how-to-remove-log-files-history-etc#answer-215188)
如何在AWS弹性beanstalk中管理应用程序日志?我是说你把应用程序日志写到哪个文件?我在我的开发环境中使用以下日志记录配置,但是当我在AWS中部署时,这不起作用.
提前致谢!
DEBUG_LOG_DIR = BASE_DIR + "/django_debug.log"
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
# How to format the output
'formatters': {
'standard': {
'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
'datefmt' : "%d/%b/%Y %H:%M:%S"
},
},
# Log handlers (where to go)
'handlers': {
'null': {
'level':'DEBUG',
'class':'django.utils.log.NullHandler',
},
'log_file': {
'level':'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'filename': DEBUG_LOG_DIR,
'maxBytes': 50000,
'backupCount': 2,
'formatter': 'standard',
},
'console':{
'level':'INFO',
'class':'logging.StreamHandler',
'formatter': 'standard'
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
},
},
# Loggers (where does …Run Code Online (Sandbox Code Playgroud) 我正在尝试部署一个我一直在使用 django 的项目。在开发中,我一直在使用 SQLite,在生产中我尝试使用 MySQL。
通常当我创建 EB 实例时,一切运行正常,并且控制台显示状态正常。在尝试部署(在 ebcli 中运行 eb deploy)时,我遇到了以下错误
2020/06/18 15:59:50.357281 [INFO] Copying file /opt/elasticbeanstalk/config/private/rsyslog.conf to /etc/rsyslog.d/web.conf
2020/06/18 15:59:50.358945 [INFO] Running command /bin/sh -c systemctl restart rsyslog.service
2020/06/18 15:59:50.394223 [INFO] Executing instruction: PostBuildEbExtension
2020/06/18 15:59:50.394243 [INFO] No plugin in cfn metadata.
2020/06/18 15:59:50.394252 [INFO] Starting executing the config set Infra-EmbeddedPostBuild.
2020/06/18 15:59:50.394273 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-init -s arn:aws:cloudformation:eu-west-2:433403353655:stack/awseb-e-qamgvpp7ft-stack/3e6774d0-b17c-11ea-9476-0a5f6fd32d44 -r AWSEBAutoScalingGroup --region eu-west-2 --configsets Infra-EmbeddedPostBuild
2020/06/18 15:59:50.721919 [ERROR] Error occurred during build: Command 01_migrate failed
2020/06/18 …Run Code Online (Sandbox Code Playgroud) 我在 Elastic Beanstalk (Amazon Linux 2) 上使用 Django Python 3.7 并且以下命令失败:
container_commands:
01_migrate:
command: "pipenv run python ./manage.py migrate"
leader_only: true
Run Code Online (Sandbox Code Playgroud)
2020-07-17 09:31:57,017 [ERROR] Command 01_migrate (pipenv run python ./manage.py migrate) failed
2020-07-17 09:31:57,017 [ERROR] Error encountered during build of postbuild_0_sarahandanatol: Command 01_migrate failed
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
changes['commands'] = CommandTool().apply(self._config.commands)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
raise ToolError(u"Command %s failed" % name)
ToolError: Command …Run Code Online (Sandbox Code Playgroud)