Example #1
0
func enableLog2File(conf *config, args cli.Args) {
	if conf.IsSysloggingEnabled() {
		fatalIf(probe.NewError(errInvalidArgument), "Syslog logging already enabled. Please remove before enabling file.", nil)
	}
	if conf.IsMongoLoggingEnabled() {
		fatalIf(probe.NewError(errInvalidArgument), "Mongo logging already enabled. Please remove before enabling file.", nil)
	}
	conf.FileLogger.Filename = args.Get(0)
	err := saveConfig(conf.configV2)
	fatalIf(err.Trace(), "Unable to save config.", nil)
}
Example #2
0
func enableLog2Syslog(conf *config, args cli.Args) {
	if conf.IsFileLoggingEnabled() {
		fatalIf(probe.NewError(errInvalidArgument), "File logging already enabled. Please remove before enabling syslog.", nil)
	}
	if conf.IsMongoLoggingEnabled() {
		fatalIf(probe.NewError(errInvalidArgument), "Mongo logging already enabled. Please remove before enabling syslog.", nil)
	}
	conf.SyslogLogger.Addr = args.Get(0)
	conf.SyslogLogger.Network = args.Get(1)
	err := saveConfig(conf.configV2)
	fatalIf(err.Trace(), "Unable to save config.", nil)
}
func enableLog2File(conf *config, args cli.Args) {
	if conf.IsSysloggingEnabled() {
		Infoln("Syslog logging already enabled. Removing automatically by enabling file logging.")
		conf.SyslogLogger.Addr = ""
		conf.SyslogLogger.Network = ""
	}
	if conf.IsMongoLoggingEnabled() {
		Infoln("Mongo logging already enabled. Removing automatically by enabling file logging.")
		conf.MongoLogger.Addr = ""
		conf.MongoLogger.DB = ""
		conf.MongoLogger.Collection = ""
	}
	conf.FileLogger.Filename = args.Get(0)
	err := saveConfig(conf.configV2)
	fatalIf(err.Trace(), "Unable to save file logging config.", nil)
}
Example #4
0
func enableLog2Mongo(conf *config, args cli.Args) {
	if conf.IsFileLoggingEnabled() {
		fatalIf(probe.NewError(errInvalidArgument), "File logging already enabled. Please remove before enabling mongo.", nil)
	}
	if conf.IsSysloggingEnabled() {
		fatalIf(probe.NewError(errInvalidArgument), "Syslog logging already enabled. Please remove before enabling mongo.", nil)
	}
	conf.MongoLogger.Addr = args.Get(0)
	conf.MongoLogger.DB = args.Get(1)
	conf.MongoLogger.Collection = args.Get(2)

	err := saveConfig(conf.configV2)
	fatalIf(err.Trace(), "Unable to save config.", nil)
}