我已经部署了一个nodejs应用,使用弹性豆茎与nginx。
当我检查日志目录时,varlognginx
但是在varloghealthd文件夹中,有一个daemon.log文件,我每隔5秒就会收到以下错误信息。
# Logfile created on 2019-10-04 13:46:46 +0000 by logger.rb/47272
A, [2019-10-04T13:46:46.849261 #8094] ANY -- : healthd daemon 1.0.3 initialized
W, [2019-10-04T13:46:47.011762 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:46:52.012037 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:46:57.012270 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:47:02.012593 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:47:07.012811 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:47:12.013037 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:47:17.013245 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:47:22.013467 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:47:27.013679 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
W, [2019-10-04T13:47:32.013903 #8094] WARN -- : log file "/var/log/nginx/healthd/application.log.2019-10-04-13" does not exist
那么如何让守护进程读取nginx的healthd日志文件呢?
我也遇到了这个神秘的错误。让人觉得特别神秘的是,如果你检查一下,你会发现varlognginxhealthdapplication.log.XXX确实存在!
我发现的是,在某些情况下,healthd需要额外的配置来解决这个错误。
来看看这个。https:/docs.aws.amazon.comelasticbeanstalklatestdghealth-enhanced-serverlogs.html。
当我向Healthd提供了正确的日志形成配置后,这个错误就消失了。