从webapp,最终用户将指定获取日志的开始时间和结束时间(以.zip格式或仅显示新标签中的日志)。我想用cloudwatch来记录elasticbeanstalk。这样做有哪些可用的JAVA api?比如启用cloudwatch登录elasticbeanstalk并创建日志流等
答案 0 :(得分:0)
为什么要使用java api?您可以按照以下步骤安装&在EB ENV中配置cloud-watch日志。
云监视日志安装示例配置&配置:强>
packages:
yum:
awslogs: []
container_commands:
01_get_awslogs_conf_file:
command: "cp .ebextensions/awslogs.conf /etc/awslogs/awslogs.conf"
03_restart_awslogs:
command: "sudo service awslogs restart"
04_start_awslogs_at_system_boot:
command: "sudo chkconfig awslogs on"
awslogs.conf的示例文件
[general]
state_file = value
logging_config_file = value
use_gzip_http_content_encoding = [true | false]
[logstream1]
log_group_name = value
log_stream_name = value
datetime_format = value
time_zone = [LOCAL|UTC]
file = value
file_fingerprint_lines = integer | integer-integer
multi_line_start_pattern = regex | {datetime_format}
initial_position = [start_of_file | end_of_file]
encoding = [ascii|utf_8|..]
buffer_duration = integer
batch_count = integer
batch_size = integer
如果您未在AWS控制台上的云监视日志下登录,请检查服务器上的代理日志。代理默认日志路径为 /var/log/awslogs.log
希望,这将帮助您在EB上设置云观察日志。