Skip to content

Commit 875f8a2

Browse files
committed
[FAB-3687] rotate /example/cluster logs
The current code configures the peer to be quite chatty and we do not place any limits on logfile size. Therefore, it is quite easy to fill up disk space. This patch fixes this by both reducing the verbosity of the peers as well as placing size/rotation limits in the docker configuration. Fixes FAB-3687 Change-Id: I7bf41c240f4aed0f46014df7be2f8e4ebcb600a9 Signed-off-by: Greg Haskins <[email protected]>
1 parent 1d31ce3 commit 875f8a2

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

examples/cluster/compose/docker-compose.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ services:
1010
- FABRIC_CA_SERVER_TLS_ENABLED=${TLS_ENABLED}
1111
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server/tls/ca.crt
1212
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server/tls/ca.key
13+
logging: &logging
14+
driver: json-file
15+
options:
16+
max-size: "25m"
17+
max-file: "2"
1318
volumes:
1419
- ../build/nodes/ca/tls:/etc/hyperledger/fabric-ca-server/tls
1520

@@ -19,6 +24,8 @@ services:
1924
dns_search: .
2025
environment:
2126
- ORDERER_GENERAL_TLS_ENABLED=${TLS_ENABLED}
27+
logging:
28+
<<: *logging
2229
volumes:
2330
- ../build/nodes/orderer:/etc/hyperledger/fabric
2431

@@ -32,6 +39,8 @@ services:
3239
- CORE_PEER_ADDRESS=peer1:7051
3340
- CORE_PEER_GOSSIP_ENDPOINT=peer1:7051
3441
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.net:7051
42+
logging:
43+
<<: *logging
3544
volumes:
3645
- ../build/nodes/peer1:/etc/hyperledger/fabric
3746
depends_on:
@@ -47,6 +56,8 @@ services:
4756
- CORE_PEER_ADDRESS=peer2:7051
4857
- CORE_PEER_GOSSIP_ENDPOINT=peer2:7051
4958
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer2.org1.net:7051
59+
logging:
60+
<<: *logging
5061
volumes:
5162
- ../build/nodes/peer2:/etc/hyperledger/fabric
5263
depends_on:
@@ -63,6 +74,8 @@ services:
6374
- CORE_PEER_ADDRESS=peer3:7051
6475
- CORE_PEER_GOSSIP_ENDPOINT=peer3:7051
6576
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer3.org1.net:7051
77+
logging:
78+
<<: *logging
6679
volumes:
6780
- ../build/nodes/peer3:/etc/hyperledger/fabric
6881
depends_on:
@@ -79,6 +92,8 @@ services:
7992
- CORE_PEER_ADDRESS=peer4:7051
8093
- CORE_PEER_GOSSIP_ENDPOINT=peer4:7051
8194
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer4.org1.net:7051
95+
logging:
96+
<<: *logging
8297
volumes:
8398
- ../build/nodes/peer4:/etc/hyperledger/fabric
8499
depends_on:

examples/cluster/config/core.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ logging:
3030
# Developers: Please see fabric/docs/Setup/logging-control.md for more
3131
# options.
3232
peer: warning
33-
node: info
33+
node: warning
3434
network: warning
3535
version: warning
36-
protoutils: debug
36+
protoutils: warning
3737
error: warning
3838
msp: warning
39-
gossip: debug
39+
gossip: warning
4040

4141
format: '%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}'
4242

0 commit comments

Comments
 (0)