aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 29cf7d836..684f15136 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -47,6 +47,9 @@ type Config struct {
KeyManager *crypto.KeyManager
}
+var logger = ethlogger.NewLogger("SERV")
+var jsonlogger = ethlogger.NewJsonLogger()
+
func (cfg *Config) parseBootNodes() []*discover.Node {
var ns []*discover.Node
for _, url := range strings.Split(cfg.BootNodes, " ") {
@@ -96,7 +99,7 @@ type Ethereum struct {
func New(config *Config) (*Ethereum, error) {
// Boostrap database
- logger := ethlogger.New(config.DataDir, config.LogFile, config.LogLevel)
+ logger := ethlogger.New(config.DataDir, config.LogFile, config.LogLevel, config.LogFormat)
db, err := ethdb.NewLDBDatabase("blockchain")
if err != nil {
return nil, err
@@ -236,6 +239,13 @@ func (s *Ethereum) Coinbase() []byte {
// Start the ethereum
func (s *Ethereum) Start() error {
+ jsonlogger.LogJson(&ethlogger.LogStarting{
+ ClientString: s.ClientIdentity().String(),
+ Coinbase: ethutil.Bytes2Hex(s.KeyManager().Address()),
+ ProtocolVersion: ProtocolVersion,
+ LogEvent: ethlogger.LogEvent{Guid: ethutil.Bytes2Hex(s.ClientIdentity().Pubkey())},
+ })
+
err := s.net.Start()
if err != nil {
return err