// LogFwdSyslog returns the syslog forwarding config.
493135
func (c *Config) LogFwdSyslog() (*syslog.RawConfig, bool) {
	partial := false
	var lfCfg syslog.RawConfig

	if s, ok := c.defined[LogForwardEnabled]; ok {
		partial = true
		lfCfg.Enabled = s.(bool)
	}

	if s, ok := c.defined[LogFwdSyslogHost]; ok && s != "" {
		partial = true
		lfCfg.Host = s.(string)
	}

	if s, ok := c.defined[LogFwdSyslogCACert]; ok && s != "" {
		partial = true
		lfCfg.CACert = s.(string)
	}

	if s, ok := c.defined[LogFwdSyslogClientCert]; ok && s != "" {
		partial = true
		lfCfg.ClientCert = s.(string)
	}

	if s, ok := c.defined[LogFwdSyslogClientKey]; ok && s != "" {
		partial = true
		lfCfg.ClientKey = s.(string)
	}

	if !partial {
		return nil, false
	}
	return &lfCfg, true
}
368984
func (r Network_Subnet_IpAddress) GetSyslogEventsOneDay() (resp []datatypes.Network_Logging_Syslog, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Subnet_IpAddress", "getSyslogEventsOneDay", nil, &r.Options, &resp)
	return
}
457903
func NewStructLogger(cfg *LogConfig) *StructLogger {
	logger := &StructLogger{
		changedValues: make(map[common.Address]Storage),
	}
	if cfg != nil {
		logger.cfg = *cfg
	}
	return logger
}
1126812
func (c *Connection) log(message string, LogLevel int, logVars ...interface{}) {
	if LogLevel <= c.LogLevel {
		c.Options.log(message, LogLevel, append([]interface{}{c.remoteAddr}, logVars...)...)
	}
}
1358967
func (ev *SplitClone) Syslog() (syslog.Priority, string) {
	return syslog.LOG_INFO, fmt.Sprintf("%s/%s/%s [split clone] %s",
		ev.Keyspace, ev.Shard, ev.Cell, ev.Status)
}
90377
func NewSyslogServer(l net.Listener, messages chan *SyslogMessage, logger hclog.Logger) *SyslogServer {
	logger = logger.Named("logcollector.server")
	parser := NewDockerLogParser(logger)
	return &SyslogServer{
		listener: l,
		messages: messages,
		parser:   parser,
		logger:   logger,
		doneCh:   make(chan interface{}),
	}
}
404153
func NewSyslogHook(network, raddr string, priority syslog.Priority, tag string) (*SyslogHook, error) {
	w, err := syslog.Dial(network, raddr, priority, tag)
	return &SyslogHook{w, network, raddr}, err
}
1215147
func onelinelog(ctx context.Context, workingDir, refspec string, subdirs []string) ([]Commit, error) {
	out := &bytes.Buffer{}
	args := []string{"log", "--pretty=format:%GK|%H|%s", refspec}
	args = append(args, "--")
	if len(subdirs) > 0 {
		args = append(args, subdirs...)
	}

	if err := execGitCmd(ctx, args, gitCmdConfig{dir: workingDir, out: out}); err != nil {
		return nil, err
	}

	return splitLog(out.String())
}
246343
func unixSyslog() (conn serverConn, err error) {
	logTypes := []string{"unixgram", "unix"}
	logPaths := []string{"/dev/log", "/var/run/syslog", "/var/run/log"}
	for _, network := range logTypes {
		for _, path := range logPaths {
			conn, err := net.DialTimeout(network, path, localDeadline)
			if err != nil {
				continue
			} else {
				return &netConn{conn: conn, local: true}, nil
			}
		}
	}
	return nil, errors.New("Unix syslog delivery error")
}
499532
func (e *ModelWatcher) LogForwardConfig() (*syslog.RawConfig, bool, error) {
	// TODO(wallyworld) - lp:1602237 - this needs to have it's own backend implementation.
	// For now, we'll piggyback off the ModelConfig API.
	modelConfig, err := e.ModelConfig()
	if err != nil {
		return nil, false, err
	}
	cfg, ok := modelConfig.LogFwdSyslog()
	return cfg, ok, nil
}
219244
func (l *logStream) Log(msg *logger.Message) error {
	l.lock.RLock()
	defer l.lock.RUnlock()
	if l.closed {
		return errors.New("awslogs is closed")
	}
	if l.logNonBlocking {
		select {
		case l.messages <- msg:
			return nil
		default:
			return errors.New("awslogs buffer is full")
		}
	}
	l.messages <- msg
	return nil
}
591104
func (tc *TabletChange) Syslog() (syslog.Priority, string) {
	return syslog.LOG_INFO, fmt.Sprintf("%s/%s/%s [tablet] %s",
		tc.Tablet.Keyspace, tc.Tablet.Shard, topoproto.TabletAliasString(tc.Tablet.Alias), tc.Status)
}
1373058
func SyslogUDPStart(kind, address string, l *logtap.Logtap) (io.Closer, error) {
	parsedAddress, err := net.ResolveUDPAddr("udp", address)
	if err != nil {
		return nil, err
	}
	socket, err := net.ListenUDP("udp", parsedAddress)
	if err != nil {
		return nil, err
	}
	go func() {
		var buf []byte = make([]byte, 1024)
		for {
			n, remote, err := socket.ReadFromUDP(buf)
			if err != nil {
				return
			}
			if remote != nil {
				if n > 0 {
					// handle parsing in another process so that this one can continue to receive
					// UDP packets
					go func(buf []byte) {
						msg := parseMessage(buf[0:n])
						msg.Type = kind
						l.WriteMessage(msg)
					}(buf)
				}
			}
		}
	}()

	return socket, nil
}
270846
func NewDefaultSyslogWriter(level loggo.Level, tag, facility string) loggo.Writer {
	if facility == "" {
		facility = "LOCAL7"
	}
	var syslogger gsyslog.Syslogger
	var err error
	// retry opening the syslog device as this may fail under load or in cases where the
	// process is forked.
	for i := 0; i < 3; i++ {
		syslogger, err = gsyslog.NewLogger(convertLevel(level), facility, tag)
		if err == nil {
			continue
		}
		// back off for a second
		time.Sleep(1 * time.Second)
	}
	if err != nil {
		panic(err) // of course this will never happen
	}
	return &syslogWriter{syslogger, DefaultFormatter}
}
900903
func (l *DefaultLogger) Log(level int, msg string, args []interface{}) {
	// log if the log level (warn=4) >= level of message (err=3)
	if l.level < level || silent {
		return
	}
	l.formatter.Format(l.writer, level, msg, args)
}
661866
func Syslogf(p Priority, format string, a ...interface{}) {
	Syslog(p, fmt.Sprintf(format, a...))
}
247108
func (o *Enterprise) SyslogDestinations(info *bambou.FetchingInfo) (SyslogDestinationsList, *bambou.Error) {

	var list SyslogDestinationsList
	err := bambou.CurrentSession().FetchChildren(o, SyslogDestinationIdentity, &list, info)
	return list, err
}