![](/img/trans.png)
[英]How to create a custom log and stream it to cloudwatch through AWS Cloudformation template in elasticbeanstalk ?
[英]aws cloudwatch log for elasticbeanstalk
最終用戶將從webapp中指定獲取日志的開始時間和結束時間(采用.zip格式或僅在新選項卡中顯示日志)。 我想使用cloudwatch記錄Elasticbeanstalk。 有哪些可用的JAVA api可以做到這一點。 例如在elasticbeanstalk中啟用cloudwatch日志並創建日志流等
為什么要使用Java API? 您可以按照以下步驟在EB ENV中安裝和配置雲監視日志。
雲監視日志安裝和配置的示例配置:
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控制台上的cloud-watch日志下獲取日志,請檢查服務器上的代理日志。 代理程序的默認日志路徑為/var/log/awslogs.log
希望,這將幫助您在EB上設置雲監視日志。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.