AWS RDS未将常规日志上传到CloudWatch Logs

时间:2019-03-18 07:51:22

标签: amazon-web-services amazon-rds amazon-cloudwatch

我想将RDS实例的常规日志上传到CloudWatch Logs。

这是我设置的配置:

  1. @RestController public class SomeController { @Autowired private SomeService someService; @PostMapping("/parents/{parentEntityId}/childs") public ResponseEntity<Void> save(@PathVariable("parentEntityId") Long parentEntityId, @RequestBody ChildDto childDto) { ChildEntity childEntity = childDtoMapper.fromDto(childDto); someService.saveChild(parentEntityId, childEntity); return ResponseEntity.created(...).build(); } } public class SomeServiceImpl { @Autowired private ParentEntityRepository parentEntityRepository; @Autowired private ChildEntityRepository childEntityRepository; public ChildEntity saveChild(final long parentEntityId, final ChildEntity childEntity){ Optional<ParentEntity> parentEntity = parentEntityRepository.findById(parentEntityId); if (parentEntity.isPresent()) { childEntity.setParent(parentEntity.get()); childEntityRepository.save(childEntity); return childEntity; } throw new EntityNotFoundException("Parent entity not found!"); } } 部分中选择General log

enter image description here

  1. 启用常规登录参数组:

enter image description here

设置了以上选项后,我仍然无法在CloudWatch的日志组中找到日志。

还有其他我忘记配置的东西吗?

1 个答案:

答案 0 :(得分:0)

根据document,我必须设置log_output = FILE才能将日志写入文件系统并将其发布到CloudWatch Logs。