diff --git a/pkg/config/config.go b/pkg/config/config.go
new file mode 100644
index 0000000..d395bb2
--- /dev/null
+++ b/pkg/config/config.go
@@ -0,0 +1,256 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Package config Common Logger initialization
+package config
+
+import (
+	"fmt"
+	"os"
+	"strconv"
+	"time"
+)
+
+// Constants defined for environment variables
+const (
+	envLogLevel            = "LOG_LEVEL"
+	envMsgbusEndPoint      = "MSGBUS_END_POINT"
+	envMsgbusRetryInterval = "MSGBUS_RETRY_INTERVAL"
+	envDbEndPoint          = "DB_END_POINT"
+	envDbTimeout           = "DB_TIMEOUT"
+	envGrpcEndPoint        = "GRPC_END_POINT"
+	envGrpcRetryInterval   = "GRPC_RETRY_INTERVAL"
+	envGrpcBackoffMaxDelay = "GRPC_BACKOFF_MAX_DELAY"
+	envGrpcMaxRetryCount   = "GRPC_MAX_RETRY_COUNT"
+	envSecureConnection    = "SECURE_GRPC"
+)
+
+// Default values defined if not provided through environment variables
+const (
+	defaultLogLevel            = LogLevelDebug
+	defaultMsgbusEndPoint      = "127.0.0.1:9092"
+	defaultMsgbusRetryInterval = 10 * time.Second
+	defaultDbEndPoint          = "127.0.0.1:2379"
+	defaultDbTimeout           = 5 * time.Second
+	defaultGrpcEndPoint        = "0.0.0.0:9292"
+	defaultGrpcRetryInterval   = 10 * time.Second
+	defaultGrpcBackoffMaxDelay = 30 * time.Second
+	defaultGrpcMaxRetryCount   = 5
+	defaultGrpcHostName        = "DMI"
+	defaultSecureConnection    = false
+)
+
+// Constants defined for certiifcates
+const (
+	pathRootCaCrt = "/etc/Root_CA.crt"
+	pathServerCrt = "/etc/grpc_server.crt"
+	pathServerKey = "/etc/grpc_server.key"
+)
+
+// DB versions
+const (
+	DBVer1 = "v1"
+)
+
+// Constants defined for Db
+const (
+	KVStore  = "etcd"
+	DBPrefix = "/OpenDevMgr/"
+	CurDBVer = DBVer1
+)
+
+// Constants defined for Msgbus Topic to receive messages
+const (
+	OpenDevMgrEventsTopic   = "dm.events"
+	OpenDevMgrMetricsTopic  = "dm.metrics"
+	OpenDevMgrEventsMsgType = "OPEN-DEV-MGR-EVENTS-MSG"
+)
+
+// Log Level Constants
+const (
+	LogLevelDebug = "DEBUG"
+	LogLevelInfo  = "INFO"
+	LogLevelWarn  = "WARN"
+	LogLevelError = "ERROR"
+)
+
+type correlationIdType int8
+
+// Constants defined for context management
+const (
+	RequestIdKey correlationIdType = iota
+	SessionIdKey
+)
+
+// ContextId constant used to print context id in logs
+const (
+	ContextId = "context-id"
+)
+
+var coreFlags *CoreFlags
+
+// NewCoreFlags creates a new CoreFlag object for you
+func NewCoreFlags() *CoreFlags {
+	if coreFlags != nil {
+		return coreFlags
+	}
+	coreFlags = new(CoreFlags)
+	coreFlags.LogLevel = defaultLogLevel
+	coreFlags.MsgbusEndPoint = defaultMsgbusEndPoint
+	coreFlags.MsgbusRetryInterval = defaultMsgbusRetryInterval
+	coreFlags.DbEndPoint = defaultDbEndPoint
+	coreFlags.DbTimeout = defaultDbTimeout
+	coreFlags.SecureConnection = defaultSecureConnection
+	coreFlags.GrpcFlags.GrpcEndPoint = defaultGrpcEndPoint
+	coreFlags.GrpcFlags.GrpcRetryInterval = defaultGrpcRetryInterval
+	coreFlags.GrpcFlags.GrpcBackoffMaxDelay = defaultGrpcBackoffMaxDelay
+	coreFlags.GrpcFlags.GrpcMaxRetryCount = defaultGrpcMaxRetryCount
+	coreFlags.GrpcFlags.GrpcHostName = defaultGrpcHostName
+	coreFlags.CertsPath.RootCaCrt = pathRootCaCrt
+	coreFlags.CertsPath.ServerCrt = pathServerCrt
+	coreFlags.CertsPath.ServerKey = pathServerKey
+	return coreFlags
+}
+
+// GetCoreFlags returns the entire config values
+func GetCoreFlags() *CoreFlags {
+	if coreFlags != nil {
+		return coreFlags
+	}
+	return nil
+}
+
+// GetGrpcFlags returns the grpc config values
+func GetGrpcFlags() *GrpcFlags {
+	if coreFlags != nil {
+		return &coreFlags.GrpcFlags
+	}
+	return nil
+}
+
+// GrpcFlags is struct defined to store grpc parameters
+type GrpcFlags struct {
+	GrpcEndPoint        string
+	GrpcRetryInterval   time.Duration
+	GrpcBackoffMaxDelay time.Duration
+	GrpcMaxRetryCount   int
+	GrpcHostName        string
+}
+
+// CertsPath is struct defined to store certificates path
+type CertsPath struct {
+	RootCaCrt string
+	ServerCrt string
+	ServerKey string
+}
+
+// CoreFlags is a structure defined to store all configurations
+type CoreFlags struct {
+	LogLevel            string
+	MsgbusEndPoint      string
+	MsgbusRetryInterval time.Duration
+	DbEndPoint          string
+	DbTimeout           time.Duration
+	SecureConnection    bool
+	GrpcFlags
+	CertsPath
+}
+
+// ParseEnv method retrieves environment variables passed and replaces with
+// corresponding default variables stored in the CoreFlags object
+func (cf *CoreFlags) ParseEnv() {
+
+	if env := os.Getenv(envLogLevel); env != "" {
+		cf.LogLevel = env
+	}
+	fmt.Printf("Environment variable '%s' setting to : %s\n", envLogLevel, cf.LogLevel)
+
+	if env := os.Getenv(envMsgbusEndPoint); env != "" {
+		cf.MsgbusEndPoint = env
+	}
+	fmt.Printf("Environment variable '%s' setting to : %s\n", envMsgbusEndPoint, cf.MsgbusEndPoint)
+
+	if env := os.Getenv(envMsgbusRetryInterval); env != "" {
+		interval, err := strconv.Atoi(env)
+		if err == nil {
+			cf.MsgbusRetryInterval = time.Duration(interval) * time.Second
+		} else {
+			fmt.Printf("Invalid value '%s' passed for '%s'. Taking the default value.\n", env, envMsgbusRetryInterval)
+		}
+	}
+	fmt.Printf("Environment variable '%s' setting to : %s\n", envMsgbusRetryInterval, cf.MsgbusRetryInterval)
+
+	if env := os.Getenv(envDbEndPoint); env != "" {
+		cf.DbEndPoint = env
+	}
+	fmt.Printf("Environment variable '%s' setting to : %s\n", envDbEndPoint, cf.DbEndPoint)
+
+	if env := os.Getenv(envDbTimeout); env != "" {
+		interval, err := strconv.Atoi(env)
+		if err == nil {
+			cf.DbTimeout = time.Duration(interval) * time.Second
+		} else {
+			fmt.Printf("Invalid value '%s' passed for '%s'. Taking the default value.\n", env, envDbTimeout)
+		}
+	}
+	fmt.Printf("Environment variable '%s' setting to : %s\n", envDbTimeout, cf.DbTimeout)
+
+	if env := os.Getenv(envGrpcEndPoint); env != "" {
+		cf.GrpcFlags.GrpcEndPoint = env
+	}
+	fmt.Printf("Environment variable '%s' setting to : %s\n", envGrpcEndPoint, cf.GrpcFlags.GrpcEndPoint)
+
+	if env := os.Getenv(envGrpcRetryInterval); env != "" {
+		interval, err := strconv.Atoi(env)
+		if err == nil {
+			cf.GrpcFlags.GrpcRetryInterval = time.Duration(interval) * time.Second
+		} else {
+			fmt.Printf("Invalid value '%s' passed for '%s'. Taking the default value.\n", env, envGrpcRetryInterval)
+		}
+	}
+	fmt.Printf("Environment variable '%s' setting to : %s\n", envGrpcRetryInterval, cf.GrpcFlags.GrpcRetryInterval)
+
+	if env := os.Getenv(envGrpcBackoffMaxDelay); env != "" {
+		interval, err := strconv.Atoi(env)
+		if err == nil {
+			cf.GrpcFlags.GrpcBackoffMaxDelay = time.Duration(interval) * time.Second
+		} else {
+			fmt.Printf("Invalid value '%s' passed for '%s'. Taking the default value.\n", env, envGrpcBackoffMaxDelay)
+		}
+	}
+	fmt.Printf("Environment variable '%s' setting to : %s\n", envGrpcBackoffMaxDelay, cf.GrpcFlags.GrpcBackoffMaxDelay)
+
+	if env := os.Getenv(envGrpcMaxRetryCount); env != "" {
+		maxRetry, err := strconv.Atoi(env)
+		if err == nil {
+			cf.GrpcFlags.GrpcMaxRetryCount = maxRetry
+		} else {
+			fmt.Printf("Invalid value '%s' passed for '%s'. Taking the default value.\n", env, envGrpcMaxRetryCount)
+		}
+	}
+	fmt.Printf("Environment variable '%s' setting to : %v\n", envGrpcMaxRetryCount, cf.GrpcFlags.GrpcMaxRetryCount)
+
+	if env := os.Getenv(envSecureConnection); env != "" {
+		secureCon, err := strconv.ParseBool(env)
+		if err == nil {
+			cf.SecureConnection = secureCon
+		} else {
+			fmt.Printf("Invalid value '%s' passed for '%s'. Taking the default value.\n", env, envSecureConnection)
+		}
+	}
+	fmt.Printf("Environment variable '%s' setting to : %v\n", envSecureConnection, cf.SecureConnection)
+
+}
diff --git a/pkg/config/core.go b/pkg/config/core.go
new file mode 100644
index 0000000..f828138
--- /dev/null
+++ b/pkg/config/core.go
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Package config Common Logger initialization
+package config
+
+import (
+	"context"
+	"fmt"
+
+	"github.com/google/uuid"
+)
+
+var ctxGlobal context.Context
+
+// Core represent read,write core attributes
+type Core struct {
+	Ctx     context.Context
+	Cancel  context.CancelFunc
+	Stopped chan struct{}
+}
+
+// NewCoreConfig will give the new core configuration
+func NewCoreConfig() *Core {
+	ctx, cancelCtx := context.WithCancel(context.Background())
+	core := &Core{Ctx: ctx, Cancel: cancelCtx, Stopped: make(chan struct{})}
+	ctxGlobal = ctx
+	return core
+}
+
+// GetContext returns global context
+func GetContext() context.Context {
+	return ctxGlobal
+}
+
+func retConstructedContxt(ctx context.Context, msg string) context.Context {
+	id, _ := uuid.NewRandom()
+	var reqID string
+	if msg != "" {
+		reqID = fmt.Sprintf("%s-%v", msg, id)
+	} else {
+		reqID = fmt.Sprintf("%v", id)
+	}
+	ctx2 := context.WithValue(ctx, RequestIdKey, reqID)
+	return ctx2
+}
+
+// GetNewContextFromGlobalContxt returns context from global context
+func GetNewContextFromGlobalContxt(msg string) context.Context {
+	return retConstructedContxt(ctxGlobal, msg)
+}
+
+// GetNewContextFromContxt returns new context from passed context
+func GetNewContextFromContxt(ctx context.Context, msg string) context.Context {
+	return retConstructedContxt(ctx, msg)
+}
diff --git a/pkg/config/logger.go b/pkg/config/logger.go
new file mode 100644
index 0000000..d6f4ffa
--- /dev/null
+++ b/pkg/config/logger.go
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Package config Common log initialization
+package config
+
+import (
+	log "github.com/opencord/voltha-lib-go/v4/pkg/log"
+)
+
+// logger represents the log object
+var logger log.CLogger
+
+// Initlog initialise log package
+func Initlog() log.CLogger {
+	if logger != nil {
+		return logger
+	}
+	// Setup this package so that it's log level can be modified at run time
+	var err error
+
+	coreFlags := NewCoreFlags()
+
+	var logLevel log.LogLevel
+
+	switch coreFlags.LogLevel {
+	case LogLevelDebug:
+		logLevel = log.DebugLevel
+	case LogLevelInfo:
+		logLevel = log.InfoLevel
+	case LogLevelWarn:
+		logLevel = log.WarnLevel
+	case LogLevelError:
+		logLevel = log.ErrorLevel
+	default:
+		logLevel = log.ErrorLevel
+	}
+
+	logger, err = log.RegisterPackage(log.JSON, logLevel, log.Fields{})
+	if err != nil {
+		panic(err)
+	}
+	return logger
+}
