ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.85k stars 901 forks source link

Log version on startup #6374

Closed Sjors closed 1 year ago

Sjors commented 1 year ago

Whenever I update to the latest version (using make install) I always like to sanity check if I indeed installed the latest version and if things are working.

I can use getinfo, but it would be easier if the debug log outputs the version number on startup.

In addition it would be good to add some blank lines or ASCII art on startup so it's easier to see where to start reading.

Current log:

2023-07-02T08:46:24.244Z DEBUG   0202e7727ee46d943a44c7bf0dce14220a839630dee67d03446bf935178b55a0df-gossipd: Received channel_update for channel 692947x2212x0/1 now DISABLED
2023-07-02T08:46:24.572Z DEBUG   030b5d1a2f2502eb14f7dfccd6de8d227cc533fe14214c80ecb5dd9bd6ef9dc8e9-gossipd: Received channel_update for channel 795165x1836x0/0 now ACTIVE
2023-07-02T08:46:24.587Z DEBUG   030b5d1a2f2502eb14f7dfccd6de8d227cc533fe14214c80ecb5dd9bd6ef9dc8e9-gossipd: Received channel_update for channel 796240x355x0/0 now ACTIVE
2023-07-02T08:48:00.334Z DEBUG   lightningd: Opened log file /home/lightning/log/debug.log
2023-07-02T08:48:00.353Z DEBUG   plugin-manager: started(1269321) /home/lightning/libexec/c-lightning/plugins/autoclean
2023-07-02T08:48:00.366Z DEBUG   plugin-manager: started(1269322) /home/lightning/libexec/c-lightning/plugins/chanbackup
2023-07-02T08:48:00.379Z DEBUG   plugin-manager: started(1269323) /home/lightning/libexec/c-lightning/plugins/bcli
vincenzopalazzo commented 1 year ago

this is not helping you?

lightningd: Server started with public key 03ef601dd16784f4e81167fcef31d17405e2ba14d6a555a002f2b15c84117cf694, alias UNITEDNIGHT-v23.05-128-g9f1e1ad (color #03ef60) and lightningd v23.05-128-g9f1e1ad
Sjors commented 1 year ago

I didn't notice that one, I guess it's not the first message after startup?

vincenzopalazzo commented 1 year ago

No, it is after the ------------------ line when the daemon will start (after migrating the database and all the other stuff, so it can take a while to show up on the log

Sjors commented 1 year ago

Loading the database takes a very long time for me because the backup is on a slow drive.

vincenzopalazzo commented 1 year ago

Loading the database takes a very long time for me because the backup is on a slow drive.

Yeah I was assuming this, maybe we can print more information before too, I think it is not a big deal

rustyrussell commented 1 year ago

Perhaps log_info("Version %s") in log.c just before "Opened log file"?

vincenzopalazzo commented 1 year ago

Perhaps log_info("Version %s") in log.c just before "Opened log file"?

Yeah this is what I was thinking

vincenzopalazzo commented 1 year ago

Ok this kind of fomrat should address your issue @Sjors

(cln-meta-project-py3.11) ➜  lightning git:(macros/log-version) ✗ ./lightningd/lightningd
2023-10-12T19:21:00.899Z INFO    lightningd: lightningd v23.08.1-209-gae94be4-modded
2023-10-12T19:21:00.994Z INFO    lightningd: Creating configuration directory /home/vincent/.lightning/bitcoin
2023-10-12T19:21:01.235Z INFO    lightningd: Creating database
2023-10-12T19:21:01.279Z UNUSUAL hsmd: HSM: created new hsm_secret file

Could not connect to bitcoind using bitcoin-cli. Is bitcoind running?

Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ bitcoin-cli echo 'hello world'
2023-10-12T19:21:01.349Z **BROKEN** plugin-bcli: \nCould not connect to bitcoind using bitcoin-cli. Is bitcoind running?\n\nMake sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.\n\nYou can verify that your Bitcoin Core installation is ready for use by running:\n\n    $ bitcoin-cli echo 'hello world'\n
2023-10-12T19:21:01.349Z INFO    plugin-bcli: Killing plugin: exited before we sent init
The Bitcoin backend died.