Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging policy #5299

Merged
merged 5 commits into from
Apr 6, 2023
Merged

Add logging policy #5299

merged 5 commits into from
Apr 6, 2023

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Mar 23, 2023

Motivation

Lodestar's logging should be more consistent across all contributors. It also not clear what should be logged at error vs warn, or at verbose vs debug.

This PR adds my own strong opinions and is marked as draft to receive feedback from other contributors.

@dapplion dapplion requested a review from a team as a code owner March 23, 2023 02:21
@dapplion dapplion marked this pull request as draft March 23, 2023 02:21
@dapplion dapplion added the meta-discussion Indicates a topic that requires input from various developers. label Mar 23, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: e79dd6a Previous: 887064d Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 524.56 us/op 712.14 us/op 0.74
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 49.215 us/op 48.253 us/op 1.02
BLS verify - blst-native 1.2635 ms/op 1.2805 ms/op 0.99
BLS verifyMultipleSignatures 3 - blst-native 2.5104 ms/op 2.5904 ms/op 0.97
BLS verifyMultipleSignatures 8 - blst-native 5.3718 ms/op 5.6022 ms/op 0.96
BLS verifyMultipleSignatures 32 - blst-native 19.445 ms/op 20.067 ms/op 0.97
BLS aggregatePubkeys 32 - blst-native 27.073 us/op 26.881 us/op 1.01
BLS aggregatePubkeys 128 - blst-native 105.97 us/op 104.50 us/op 1.01
getAttestationsForBlock 56.892 ms/op 63.909 ms/op 0.89
isKnown best case - 1 super set check 259.00 ns/op 267.00 ns/op 0.97
isKnown normal case - 2 super set checks 255.00 ns/op 264.00 ns/op 0.97
isKnown worse case - 16 super set checks 254.00 ns/op 262.00 ns/op 0.97
CheckpointStateCache - add get delete 4.9220 us/op 5.2480 us/op 0.94
validate gossip signedAggregateAndProof - struct 2.7687 ms/op 2.8761 ms/op 0.96
validate gossip attestation - struct 1.3141 ms/op 1.3859 ms/op 0.95
pickEth1Vote - no votes 1.2694 ms/op 1.3652 ms/op 0.93
pickEth1Vote - max votes 8.5011 ms/op 11.775 ms/op 0.72
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.6323 ms/op 9.4674 ms/op 0.91
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 14.126 ms/op 17.344 ms/op 0.81
pickEth1Vote - Eth1Data fastSerialize value x2048 727.82 us/op 729.57 us/op 1.00
pickEth1Vote - Eth1Data fastSerialize tree x2048 8.4622 ms/op 5.0493 ms/op 1.68
bytes32 toHexString 490.00 ns/op 527.00 ns/op 0.93
bytes32 Buffer.toString(hex) 357.00 ns/op 406.00 ns/op 0.88
bytes32 Buffer.toString(hex) from Uint8Array 556.00 ns/op 633.00 ns/op 0.88
bytes32 Buffer.toString(hex) + 0x 350.00 ns/op 410.00 ns/op 0.85
Object access 1 prop 0.16300 ns/op 0.18500 ns/op 0.88
Map access 1 prop 0.16000 ns/op 0.17100 ns/op 0.94
Object get x1000 6.6390 ns/op 7.0420 ns/op 0.94
Map get x1000 0.59400 ns/op 0.65400 ns/op 0.91
Object set x1000 49.934 ns/op 57.238 ns/op 0.87
Map set x1000 42.144 ns/op 47.788 ns/op 0.88
Return object 10000 times 0.23350 ns/op 0.24970 ns/op 0.94
Throw Error 10000 times 4.2241 us/op 4.4459 us/op 0.95
fastMsgIdFn sha256 / 200 bytes 3.4600 us/op 3.6310 us/op 0.95
fastMsgIdFn h32 xxhash / 200 bytes 277.00 ns/op 296.00 ns/op 0.94
fastMsgIdFn h64 xxhash / 200 bytes 416.00 ns/op 423.00 ns/op 0.98
fastMsgIdFn sha256 / 1000 bytes 11.523 us/op 12.310 us/op 0.94
fastMsgIdFn h32 xxhash / 1000 bytes 403.00 ns/op 434.00 ns/op 0.93
fastMsgIdFn h64 xxhash / 1000 bytes 478.00 ns/op 492.00 ns/op 0.97
fastMsgIdFn sha256 / 10000 bytes 100.63 us/op 109.31 us/op 0.92
fastMsgIdFn h32 xxhash / 10000 bytes 1.8380 us/op 2.0210 us/op 0.91
fastMsgIdFn h64 xxhash / 10000 bytes 1.3300 us/op 1.4360 us/op 0.93
enrSubnets - fastDeserialize 64 bits 1.2430 us/op 1.3600 us/op 0.91
enrSubnets - ssz BitVector 64 bits 486.00 ns/op 513.00 ns/op 0.95
enrSubnets - fastDeserialize 4 bits 172.00 ns/op 184.00 ns/op 0.93
enrSubnets - ssz BitVector 4 bits 488.00 ns/op 522.00 ns/op 0.93
prioritizePeers score -10:0 att 32-0.1 sync 2-0 111.21 us/op 125.68 us/op 0.88
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 138.16 us/op 160.60 us/op 0.86
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 190.59 us/op 191.84 us/op 0.99
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 394.69 us/op 353.40 us/op 1.12
prioritizePeers score 0:0 att 64-1 sync 4-1 478.89 us/op 428.13 us/op 1.12
array of 16000 items push then shift 1.7361 us/op 1.7035 us/op 1.02
LinkedList of 16000 items push then shift 9.3380 ns/op 9.1510 ns/op 1.02
array of 16000 items push then pop 121.40 ns/op 120.59 ns/op 1.01
LinkedList of 16000 items push then pop 9.4680 ns/op 9.0210 ns/op 1.05
array of 24000 items push then shift 2.5567 us/op 2.4093 us/op 1.06
LinkedList of 24000 items push then shift 9.4430 ns/op 9.5340 ns/op 0.99
array of 24000 items push then pop 87.131 ns/op 86.208 ns/op 1.01
LinkedList of 24000 items push then pop 8.9750 ns/op 10.009 ns/op 0.90
intersect bitArray bitLen 8 13.660 ns/op 14.345 ns/op 0.95
intersect array and set length 8 82.322 ns/op 89.620 ns/op 0.92
intersect bitArray bitLen 128 47.291 ns/op 45.589 ns/op 1.04
intersect array and set length 128 1.3011 us/op 1.2351 us/op 1.05
Buffer.concat 32 items 2.7210 us/op 2.8380 us/op 0.96
Uint8Array.set 32 items 2.1960 us/op 2.8230 us/op 0.78
pass gossip attestations to forkchoice per slot 3.8501 ms/op 3.1412 ms/op 1.23
computeDeltas 3.3293 ms/op 3.0552 ms/op 1.09
computeProposerBoostScoreFromBalances 1.9087 ms/op 1.8214 ms/op 1.05
altair processAttestation - 250000 vs - 7PWei normalcase 3.7601 ms/op 2.4099 ms/op 1.56
altair processAttestation - 250000 vs - 7PWei worstcase 3.3930 ms/op 3.6556 ms/op 0.93
altair processAttestation - setStatus - 1/6 committees join 143.74 us/op 152.07 us/op 0.95
altair processAttestation - setStatus - 1/3 committees join 280.75 us/op 294.76 us/op 0.95
altair processAttestation - setStatus - 1/2 committees join 379.72 us/op 389.02 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 475.96 us/op 485.74 us/op 0.98
altair processAttestation - setStatus - 4/5 committees join 653.15 us/op 678.43 us/op 0.96
altair processAttestation - setStatus - 100% committees join 802.81 us/op 825.50 us/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase 21.151 ms/op 19.148 ms/op 1.10
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.329 ms/op 27.580 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase 54.982 ms/op 53.271 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 67.038 ms/op 81.103 ms/op 0.83
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3376 ms/op 2.2785 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei worstcase 30.400 ms/op 32.269 ms/op 0.94
altair processEth1Data - 250000 vs - 7PWei normalcase 516.84 us/op 569.72 us/op 0.91
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 8.4990 us/op 8.1840 us/op 1.04
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 30.080 us/op 24.184 us/op 1.24
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 12.022 us/op 10.506 us/op 1.14
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 8.4030 us/op 8.1060 us/op 1.04
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 108.28 us/op 101.08 us/op 1.07
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 681.73 us/op 782.86 us/op 0.87
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 962.96 us/op 1.0940 ms/op 0.88
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 897.63 us/op 1.0286 ms/op 0.87
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.3646 ms/op 2.4923 ms/op 0.95
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.5323 ms/op 1.8486 ms/op 0.83
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 3.9672 ms/op 4.3451 ms/op 0.91
Tree 40 250000 create 336.58 ms/op 356.20 ms/op 0.94
Tree 40 250000 get(125000) 190.09 ns/op 201.81 ns/op 0.94
Tree 40 250000 set(125000) 964.25 ns/op 1.0450 us/op 0.92
Tree 40 250000 toArray() 19.735 ms/op 23.136 ms/op 0.85
Tree 40 250000 iterate all - toArray() + loop 19.895 ms/op 22.687 ms/op 0.88
Tree 40 250000 iterate all - get(i) 73.196 ms/op 77.367 ms/op 0.95
MutableVector 250000 create 10.774 ms/op 12.825 ms/op 0.84
MutableVector 250000 get(125000) 6.3690 ns/op 6.7190 ns/op 0.95
MutableVector 250000 set(125000) 291.64 ns/op 309.38 ns/op 0.94
MutableVector 250000 toArray() 3.2347 ms/op 4.1861 ms/op 0.77
MutableVector 250000 iterate all - toArray() + loop 3.2963 ms/op 3.4936 ms/op 0.94
MutableVector 250000 iterate all - get(i) 1.5422 ms/op 1.6534 ms/op 0.93
Array 250000 create 2.7820 ms/op 2.6802 ms/op 1.04
Array 250000 clone - spread 1.1443 ms/op 1.1486 ms/op 1.00
Array 250000 get(125000) 0.57200 ns/op 0.58900 ns/op 0.97
Array 250000 set(125000) 0.65200 ns/op 0.75800 ns/op 0.86
Array 250000 iterate all - loop 84.723 us/op 87.714 us/op 0.97
effectiveBalanceIncrements clone Uint8Array 300000 25.461 us/op 29.076 us/op 0.88
effectiveBalanceIncrements clone MutableVector 300000 340.00 ns/op 367.00 ns/op 0.93
effectiveBalanceIncrements rw all Uint8Array 300000 171.38 us/op 181.37 us/op 0.94
effectiveBalanceIncrements rw all MutableVector 300000 80.498 ms/op 85.554 ms/op 0.94
phase0 afterProcessEpoch - 250000 vs - 7PWei 114.05 ms/op 123.74 ms/op 0.92
phase0 beforeProcessEpoch - 250000 vs - 7PWei 45.848 ms/op 46.073 ms/op 1.00
altair processEpoch - mainnet_e81889 302.29 ms/op 362.31 ms/op 0.83
mainnet_e81889 - altair beforeProcessEpoch 58.723 ms/op 70.354 ms/op 0.83
mainnet_e81889 - altair processJustificationAndFinalization 16.307 us/op 17.024 us/op 0.96
mainnet_e81889 - altair processInactivityUpdates 6.0671 ms/op 6.0316 ms/op 1.01
mainnet_e81889 - altair processRewardsAndPenalties 65.587 ms/op 73.643 ms/op 0.89
mainnet_e81889 - altair processRegistryUpdates 2.5740 us/op 3.1720 us/op 0.81
mainnet_e81889 - altair processSlashings 650.00 ns/op 574.00 ns/op 1.13
mainnet_e81889 - altair processEth1DataReset 730.00 ns/op 537.00 ns/op 1.36
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3184 ms/op 1.5547 ms/op 0.85
mainnet_e81889 - altair processSlashingsReset 5.8150 us/op 4.0560 us/op 1.43
mainnet_e81889 - altair processRandaoMixesReset 4.8840 us/op 5.0050 us/op 0.98
mainnet_e81889 - altair processHistoricalRootsUpdate 972.00 ns/op 674.00 ns/op 1.44
mainnet_e81889 - altair processParticipationFlagUpdates 3.3090 us/op 3.3510 us/op 0.99
mainnet_e81889 - altair processSyncCommitteeUpdates 661.00 ns/op 670.00 ns/op 0.99
mainnet_e81889 - altair afterProcessEpoch 127.25 ms/op 135.77 ms/op 0.94
phase0 processEpoch - mainnet_e58758 353.02 ms/op 360.87 ms/op 0.98
mainnet_e58758 - phase0 beforeProcessEpoch 144.79 ms/op 132.24 ms/op 1.09
mainnet_e58758 - phase0 processJustificationAndFinalization 17.968 us/op 20.122 us/op 0.89
mainnet_e58758 - phase0 processRewardsAndPenalties 65.600 ms/op 55.790 ms/op 1.18
mainnet_e58758 - phase0 processRegistryUpdates 7.6440 us/op 7.8680 us/op 0.97
mainnet_e58758 - phase0 processSlashings 651.00 ns/op 506.00 ns/op 1.29
mainnet_e58758 - phase0 processEth1DataReset 622.00 ns/op 649.00 ns/op 0.96
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.7448 ms/op 1.2743 ms/op 1.37
mainnet_e58758 - phase0 processSlashingsReset 4.1720 us/op 8.4360 us/op 0.49
mainnet_e58758 - phase0 processRandaoMixesReset 4.0260 us/op 4.6350 us/op 0.87
mainnet_e58758 - phase0 processHistoricalRootsUpdate 672.00 ns/op 646.00 ns/op 1.04
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.5500 us/op 4.5720 us/op 0.78
mainnet_e58758 - phase0 afterProcessEpoch 101.53 ms/op 103.58 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2503 ms/op 1.2948 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4902 ms/op 1.8965 ms/op 0.79
altair processInactivityUpdates - 250000 normalcase 25.949 ms/op 30.135 ms/op 0.86
altair processInactivityUpdates - 250000 worstcase 25.957 ms/op 29.593 ms/op 0.88
phase0 processRegistryUpdates - 250000 normalcase 7.1670 us/op 7.8350 us/op 0.91
phase0 processRegistryUpdates - 250000 badcase_full_deposits 278.35 us/op 333.98 us/op 0.83
phase0 processRegistryUpdates - 250000 worstcase 0.5 130.13 ms/op 130.12 ms/op 1.00
altair processRewardsAndPenalties - 250000 normalcase 77.459 ms/op 71.283 ms/op 1.09
altair processRewardsAndPenalties - 250000 worstcase 105.01 ms/op 73.677 ms/op 1.43
phase0 getAttestationDeltas - 250000 normalcase 12.351 ms/op 7.0390 ms/op 1.75
phase0 getAttestationDeltas - 250000 worstcase 10.911 ms/op 7.5930 ms/op 1.44
phase0 processSlashings - 250000 worstcase 6.5108 ms/op 3.9278 ms/op 1.66
altair processSyncCommitteeUpdates - 250000 186.83 ms/op 193.74 ms/op 0.96
BeaconState.hashTreeRoot - No change 271.00 ns/op 372.00 ns/op 0.73
BeaconState.hashTreeRoot - 1 full validator 52.497 us/op 55.501 us/op 0.95
BeaconState.hashTreeRoot - 32 full validator 551.10 us/op 600.46 us/op 0.92
BeaconState.hashTreeRoot - 512 full validator 5.2776 ms/op 6.1384 ms/op 0.86
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 65.332 us/op 74.469 us/op 0.88
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 938.37 us/op 1.0545 ms/op 0.89
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.520 ms/op 12.766 ms/op 0.90
BeaconState.hashTreeRoot - 1 balances 50.458 us/op 56.010 us/op 0.90
BeaconState.hashTreeRoot - 32 balances 465.63 us/op 512.47 us/op 0.91
BeaconState.hashTreeRoot - 512 balances 4.4274 ms/op 5.1991 ms/op 0.85
BeaconState.hashTreeRoot - 250000 balances 72.675 ms/op 83.488 ms/op 0.87
aggregationBits - 2048 els - zipIndexesInBitList 16.513 us/op 17.529 us/op 0.94
regular array get 100000 times 33.537 us/op 35.390 us/op 0.95
wrappedArray get 100000 times 33.545 us/op 35.367 us/op 0.95
arrayWithProxy get 100000 times 16.244 ms/op 18.250 ms/op 0.89
ssz.Root.equals 763.00 ns/op 632.00 ns/op 1.21
byteArrayEquals 657.00 ns/op 564.00 ns/op 1.16
shuffle list - 16384 els 7.2156 ms/op 7.2296 ms/op 1.00
shuffle list - 250000 els 104.57 ms/op 105.87 ms/op 0.99
processSlot - 1 slots 9.5930 us/op 9.1240 us/op 1.05
processSlot - 32 slots 1.4379 ms/op 1.4628 ms/op 0.98
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 37.435 ms/op 40.710 ms/op 0.92
getCommitteeAssignments - req 1 vs - 250000 vc 3.1486 ms/op 3.0902 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 4.3070 ms/op 4.3764 ms/op 0.98
getCommitteeAssignments - req 1000 vs - 250000 vc 4.7297 ms/op 4.6727 ms/op 1.01
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.1400 ns/op 4.9700 ns/op 1.03
state getBlockRootAtSlot - 250000 vs - 7PWei 673.44 ns/op 650.80 ns/op 1.03
computeProposers - vc 250000 10.856 ms/op 11.174 ms/op 0.97
computeEpochShuffling - vc 250000 108.97 ms/op 112.71 ms/op 0.97
getNextSyncCommittee - vc 250000 180.42 ms/op 186.45 ms/op 0.97

by benchmarkbot/action

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated
- `verbose`: _TBD_
- `debug`: Detailed diagnostic information that can help developers or users troubleshoot specific issues. Examples include individual request logs for every REST API, networking interactions, or internal components status changes.

### Guideliness
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we need a guideline about when/where to include a stack trace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. How could we summarize it? I would say that when the error message provides all possible location information the stack trace can be omitted. We do not support suppressing stack traces out of the box, and the uncontrolled nature of Javascript exceptions could be an issue if we start omitting stack traces. very relevant to this topic https://www.youtube.com/watch?v=6cap2HiBFVQ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we ok with not adding a bit more details about stack traces? I think the ApiError is a pretty good example of when not to include the stack trace as changed in #5285

  • it is thrown on a higher level in the stack
  • it is explicitly thrown based on simple assertions
  • the error is expected to happen due to invalid client requests
  • the error message is usually good which makes it easy to find out where it was thrown

Not including the stack trace of course can come with a cost of not being able to easily debug an issue but this should be rarely the case if we are careful to only do it for some errors but let's not forget the cost of including the stack trace in terms of UX. Not being able to easily read the logs because of too much stack trace is also not ideal.

I would argue that debug logs can include stack traces more often/always but for levels higher than or equal info need to be more careful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just approved the PR so this didn't sit for too long. Happy to merge more verbiage about when stack traces are acceptable. Totally agree with your comment.

@nflaig
Copy link
Member

nflaig commented Mar 24, 2023

sounds pretty good to me 👍

I don't (yet) have that strong opinions on how the logging should be done within Lodestar myself but I have written (3 years ago) a log level usage/policy guide myself before which could be used as additional inspiration.

Just to add some context first, the defined logging policy was for a SaaS solution, meaning the logs were mostly meant to be consumed by developers/administrators and were used to create a log-based alerting system on top. It also has to be noted that logs were not the only tool used to diagnose issues, there were also metrics and additionally traces (jaeger) which were directly linked to logs.

This is how the logging policy was defined:

  • error - Any error or exception that is or might be critical to the operation of the application.
    It is recommended use an automated alerting system which informs a system administrator or developer about the error.
    Most of the time warn should be preferred if the issue is recoverable without manual intervention.
  • warn - Any message that warns about potential issues that could cause application oddities. Usually, those issues
    are automatically recoverable. It might also be used to warn about other potential problems such as invalid requests
    which could indicate malfunctioning of the application or even a security threat, e.g. a lot of failed login attempts.
  • info - Generally useful information to log, e.g. service start/stop, configuration assumptions, etc. Usually, those
    logs can be ignored under normal circumstances if the application is running without problems but are important to have
    if an issue occurs to help diagnose the potential cause.
  • debug - Information that is diagnostically helpful while developing the application. Debug logs should be disabled in
    a production environment during normal operation of the application. In some cases debug logs can be enabled during
    production to get additional information which might be helpful to diagnose an issue.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
@dapplion dapplion marked this pull request as ready for review March 30, 2023 00:56
@dapplion
Copy link
Contributor Author

dapplion commented Mar 30, 2023

TBH from #5320 it's not clear to me what log would be debug or trace. Do you have any specific test if a specific log should go in one or the other?

I would even argue to log everything that's not info to debug and call it a day, super simple. In our deployments we only track debug. In CI we only persist debug. And in Javascript logging is not free, if we start adding crazy frequent trace statements it's gonna impact performance

@maschad
Copy link
Contributor

maschad commented Mar 30, 2023

I would even argue to log everything that's not info to debug and call it a day, super simple. In our deployments we only track debug. In CI we only persist debug. And in Javascript logging is not free, if we start adding crazy frequent trace statements it's gonna impact performance

Given that we may want to consider whether it's ideal to have trace logs then. The primary intention of debug logs imo should be to assist developers rather than consumers, and so perhaps we should omit trace logs for now.

@nflaig
Copy link
Member

nflaig commented Mar 30, 2023

I would even argue to log everything that's not info to debug and call it a day, super simple. In our deployments we only track debug. In CI we only persist debug. And in Javascript logging is not free, if we start adding crazy frequent trace statements it's gonna impact performance

IMO using logs to do some sort of tracing is not the best option (maybe during development). Something like opentelemetry is much better to trace the application because you can nicely visualize it in jaeger and not have to read through 1000 lines of logs.

Also I would assume that trace is not enabled by default, so not very useful to retroactively diagnose an issue.

nflaig
nflaig previously requested changes Mar 30, 2023
CONTRIBUTING.md Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
@dapplion dapplion merged commit ddc58ce into unstable Apr 6, 2023
@dapplion dapplion deleted the dapplion/log-policy branch April 6, 2023 01:25
nflaig added a commit that referenced this pull request Apr 17, 2023
Replaced by "Logging policy" section added in #5299
wemeetagain pushed a commit that referenced this pull request Apr 17, 2023
Replaced by "Logging policy" section added in #5299
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.8.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-discussion Indicates a topic that requires input from various developers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants