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

AV-1463: add custom log format for chain prefix and source location #77

Merged
merged 2 commits into from
Apr 11, 2022

Conversation

ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented Apr 7, 2022

Adds chain prefixes and source location to logs, through custom log formatting.
An example output (from CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB.log)

{"@level":"debug","@message":"plugin address","@timestamp":"2022-04-07T22:09:16.334408+03:00","address":"/var/folders/qx/3vldh17n7_n2l8fd5ysyr7bw0000gn/T/plugin2351922550","network":"unix"}
{"@level":"trace","@message":"plugin received interrupt signal, ignoring","@timestamp":"2022-04-07T22:10:12.522463+03:00","count":1}
{"@level":"debug","@message":"plugin address","@timestamp":"2022-04-07T22:10:52.801265+03:00","address":"/var/folders/qx/3vldh17n7_n2l8fd5ysyr7bw0000gn/T/plugin1845823026","network":"unix"}
INFO [04-07|22:10:52.802] Initializing Subnet EVM VM               Version=v0.2.1@197b3f1bd45f11bda1fc8f45d75ce2706ab3e9ec Config="{\"snowman-api-enabled\":false,\"admin-api-enabled\":false,\"admin-api-dir\":\"\",\"eth-apis\":[\"public-eth\",\"public-eth-filter\",\"net\",\"web3\",\"internal-public-eth\",\"internal-public-blockchain\",\"internal-public-transaction-pool\"],\"continuous-profiler-dir\":\"\",\"continuous-profiler-frequency\":{\"Duration\":900000000000},\"continuous-profiler-max-files\":5,\"rpc-gas-cap\":50000000,\"rpc-tx-fee-cap\":100,\"preimages-enabled\":false,\"pruning-enabled\":true,\"snapshot-async\":true,\"snapshot-verification-enabled\":false,\"metrics-enabled\":true,\"metrics-expensive-enabled\":false,\"local-txs-enabled\":false,\"api-max-duration\":{\"Duration\":0},\"ws-cpu-refill-rate\":{\"Duration\":0},\"ws-cpu-max-stored\":{\"Duration\":0},\"api-max-blocks-per-request\":0,\"allow-unfinalized-queries\":false,\"allow-unprotected-txs\":false,\"keystore-directory\":\"\",\"keystore-external-signer\":\"\",\"keystore-insecure-unlock-allowed\":false,\"remote-tx-gossip-only-enabled\":false,\"tx-regossip-frequency\":{\"Duration\":60000000000},\"tx-regossip-max-size\":15,\"log-level\":\"info\",\"feeRecipient\":\"\",\"offline-pruning-enabled\":false,\"offline-pruning-bloom-filter-size\":512,\"offline-pruning-data-directory\":\"\",\"max-outbound-active-requests\":8}"
INFO [04-07|22:10:52.804] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/trie/database.go:750: Persisted trie from memory database nodes=5 size=806.00B time="17.541µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=-164.00B
INFO [04-07|22:10:52.804] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/eth/backend.go:133: Allocated trie memory caches clean=75.00MiB dirty=256.00MiB
INFO [04-07|22:10:52.805] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/genesis.go:195: Writing genesis to database 
INFO [04-07|22:10:52.805] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/trie/database.go:750: Persisted trie from memory database nodes=5 size=806.00B time="162.125µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=-164.00B
INFO [04-07|22:10:52.806] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/eth/backend.go:139: Initialised chain configuration config="{ChainID: 43214 Homestead: 0 EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: 0, Subnet EVM: 0, FeeConfig: {\"gasLimit\":8000000,\"targetBlockRate\":2,\"minBaseFee\":25000000000,\"targetGas\":15000000,\"baseFeeChangeDenominator\":36,\"minBlockGasCost\":0,\"maxBlockGasCost\":1000000,\"blockGasCostStep\":200000}, AllowFeeRecipients: false, ContractDeployerAllowListConfig: {{0 [0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC]}}, ContractNativeMinterConfig: {{0 [0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC]}}, Engine: Dummy Consensus Engine}"
INFO [04-07|22:10:52.806] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/eth/backend.go:173: Initialising Ethereum protocol network=43214 dbversion=<nil>
WARN [04-07|22:10:52.806] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/eth/backend.go:179: Upgrade blockchain database version from=<nil> to=8
INFO [04-07|22:10:52.807] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/blockchain.go:298: Loaded most recent local header number=0 hash=c0da56..9728d6 age=53y1w2d
INFO [04-07|22:10:52.807] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/blockchain.go:299: Loaded most recent local full block number=0 hash=c0da56..9728d6 age=53y1w2d
INFO [04-07|22:10:52.807] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/blockchain.go:253: Initializing snapshots async=false
WARN [04-07|22:10:52.807] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/state/snapshot/snapshot.go:219: Failed to load snapshot, regenerating err="missing or corrupted snapshot, no snapshot block hash"
INFO [04-07|22:10:52.807] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/state/snapshot/snapshot.go:775: Rebuilding state snapshot 
INFO [04-07|22:10:52.807] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/state/snapshot/snapshot.go:354: Waiting for snapshot generation root=231a13..626611
INFO [04-07|22:10:52.807] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/state/snapshot/generate.go:101: Wiper running, state snapshotting paused accounts=0 slots=0 storage=0.00B elapsed="162.458µs"
INFO [04-07|22:10:52.808] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/state/snapshot/wipe.go:133: Deleted state snapshot leftovers kind=accounts wiped=0 elapsed="340.042µs"
INFO [04-07|22:10:52.808] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/state/snapshot/wipe.go:133: Deleted state snapshot leftovers kind=storage  wiped=0 elapsed="162.916µs"
INFO [04-07|22:10:52.808] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/state/snapshot/generate.go:101: Resuming state snapshot generation root=231a13..626611 accounts=0 slots=0 storage=0.00B elapsed="2.791µs"
INFO [04-07|22:10:52.809] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/state/snapshot/generate.go:360: Generated state snapshot accounts=3 slots=2 storage=387.00B elapsed="635.833µs"
WARN [04-07|22:10:52.809] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/rawdb/accessors_metadata.go:111: Error reading unclean shutdown markers error="not found"
INFO [04-07|22:10:52.810] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/core/tx_pool.go:502: Transaction pool price threshold updated price=0
INFO [04-07|22:10:52.810] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/plugin/evm/vm.go:370: lastAccepted = 0xc0da563d1b0b76efdf3a7a1b51a943b53d6f081f1e35eaa9d7db88d61c9728d6 
INFO [04-07|22:10:52.810] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> snow/engine/snowman/transitive.go#67: initializing consensus engine
INFO [04-07|22:10:52.811] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> vms/proposervm/vm.go#214: block height indexing is already complete
INFO [04-07|22:10:52.811] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> snow/engine/snowman/bootstrap/bootstrapper.go#213: Starting bootstrap...
INFO [04-07|22:10:52.812] <CTfG5uAYxZhABKoqVHPgTRQF1RbHSbkc1LygbDYyycUD765qB Chain> github.com/ava-labs/subnet-evm/plugin/evm/vm.go:598: Enabled APIs: public-eth, public-eth-filter, net, web3, internal-public-eth, internal-public-blockchain, internal-public-transaction-pool 
{"@level":"trace","@message":"plugin received interrupt signal, ignoring","@timestamp":"2022-04-07T22:44:16.761969+03:00","count":1}

Copy link
Collaborator

@aaronbuchwald aaronbuchwald left a comment

Choose a reason for hiding this comment

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

LGTM

@aaronbuchwald aaronbuchwald merged commit 3dbb1e4 into master Apr 11, 2022
@aaronbuchwald aaronbuchwald deleted the chain-prefix-logs branch May 5, 2022 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants