forked from 9652040795/aws-policies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logs
42 lines (27 loc) · 1.09 KB
/
logs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 1 Attach Policy
# https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-using-import-tool-cli-cloudwatch-iam-role.html
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:DescribeLogStreams",
"logs:PutLogEvents"
],
"Resource": [
"arn:aws:logs:REGION:ACCOUNT:log-group:/aws/cognito/*"
]
}
]
}
# https://docs.docker.com/config/containers/logging/awslogs/
2. docker run --name eureka-server --log-driver=awslogs --log-opt awslogs-region=us-east-1 --log-opt awslogs-group="eureka-server" --log-opt awslogs-stream="eureka-server-log-stream" -p 8080:8761 --restart unless-stopped -id imageid:tag
# http://mvpjava.com/docker-logging-symlink-hack/
# https://youtu.be/TFCua2yj09Y
3. Dockerfile best practices for logs
---> Simply create Symbolic Links
RUN ln -sf /dev/stdout /log/server.log \
&& ln -sf /dev/stderr /log/server.log