func NewLoggerExt(component string, appGUID string) lager.Logger {
	var lagerLogLevel lager.LogLevel
	switch strings.ToUpper(config.LoggerLevel) {
	case DEBUG:
		lagerLogLevel = lager.DEBUG
	case INFO:
		lagerLogLevel = lager.INFO
	case WARN:
		lagerLogLevel = lager.WARN
	case ERROR:
		lagerLogLevel = lager.ERROR
	case FATAL:
		lagerLogLevel = lager.FATAL
	default:
		panic(fmt.Errorf("unknown logger level: %s", config.LoggerLevel))
	}
	logger := lager.NewLoggerExt(component, config.LogFormatText)
	for _, sink := range config.Writers {
		writer, ok := Writers[sink]
		if !ok {
			log.Panic("Unknown writer: ", sink)
		}
		sink := lager.NewReconfigurableSink(lager.NewWriterSink(sink, writer, lager.DEBUG, config.LogColorMode), lagerLogLevel)
		logger.RegisterSink(sink)
	}
	return logger
}
NewLoggerExt is a function which is used to write new logs
package seclog
import (
	"fmt"
	"github.com/go-chassis/seclog/third_party/forked/cloudfoundry/lager"
	"gopkg.in/natefinch/lumberjack.v2"
	"io"
	"log"
	"os"
	"strings"
	"sync"
)
const (
	DEBUG = "DEBUG"
	INFO = "INFO"
	WARN = "WARN"
	ERROR = "ERROR"
	FATAL = "FATAL"
)
type Config struct {
	LoggerLevel   string   `yaml:"loggerLevel"`
	LoggerFile    string   `yaml:"loggerFile"`
	Writers       []string `yaml:"writers"`
	LogFormatText bool     `yaml:"logFormatText"`
	LogColorMode  string   `yaml:"logColorMode"`
	RotateDisable bool `yaml:"rotateDisable"`
	MaxSize       int  `yaml:"maxSize"`
	MaxAge        int  `yaml:"maxAge"`
	MaxBackups    int  `yaml:"maxBackups"`
	Compress      bool `yaml:"compress"`
}
var config = DefaultConfig()
var m sync.RWMutex
var Writers = make(map[string]io.Writer)
func RegisterWriter(name string, writer io.Writer) {
	m.Lock()
	Writers[name] = writer
	m.Unlock()
}
func DefaultConfig() *Config {
	return &Config{
		LoggerLevel:   INFO,
		LoggerFile:    "",
		LogFormatText: false,
		LogColorMode:  lager.ColorModeAuto,
	}
}
func Init(c Config) {
	if c.LoggerLevel != "" {
		config.LoggerLevel = c.LoggerLevel
	}
	switch c.LogColorMode {
	case lager.ColorModeAuto, lager.ColorModeNever, lager.ColorModeAlways:
		config.LogColorMode = c.LogColorMode
	case "":
	default:
		panic(fmt.Sprintf("log color mode should be: %s/%s/%s, but got: %s",
			lager.ColorModeAuto, lager.ColorModeAlways, lager.ColorModeNever, c.LogColorMode))
	}
	if c.LoggerFile != "" {
		config.LoggerFile = c.LoggerFile
		config.Writers = append(config.Writers, "file")
	}
	if len(c.Writers) == 0 {
		config.Writers = append(config.Writers, "stdout")
	} else {
		config.Writers = c.Writers
	}
	config.LogFormatText = c.LogFormatText
	RegisterWriter("stdout", os.Stdout)
	var file io.Writer
	var err error
	if config.LoggerFile != "" {
		if c.RotateDisable {
			file, err = os.OpenFile(config.LoggerFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
			if err != nil {
				panic(err)
			}
		} else {
			file = &lumberjack.Logger{
				Filename:   config.LoggerFile,
				MaxSize:    c.MaxSize,  
				MaxBackups: c.MaxBackups,
				MaxAge:     c.MaxAge,    
				Compress:   c.Compress,  
			}
		}
	}
	for _, sink := range config.Writers {
		if sink == "file" {
			if file == nil {
				log.Panic("Must set file path")
			}
			RegisterWriter("file", file)
		}
	}
}
func NewLogger(component string) lager.Logger {
	return NewLoggerExt(component, component)
}