Example #1
0
// Writes to syslog-ng for a logging event.
//
// ident is used to persist you different log events to different files.
// tag is can be used for your own purpose.
func Dlog(ident string, tag string, jsonStr string) (err error) {
	_, err = syslogng.Printf(":%s,%s,%d,%s\n",
		ident,
		tag,
		time.Now().UTC().Unix(),
		jsonStr)
	return
}
Example #2
0
func (this *FunServantImpl) Dlog(ctx *rpc.Context, ident string, tag string,
	json string) (intError error) {
	// add newline and timestamp here
	if _, intError = syslogng.Printf(":%s,%s,%d,%s\n", ident, tag,
		time.Now().UTC().Unix(), json); intError != nil {
		log.Error("dlog %v", intError)
	}

	return nil
}
Example #3
0
File: dlog.go Project: jlyt898/fae
func (this *FunServantImpl) Dlog(category string, tag string,
	json string) (err error) {
	this.t1 = time.Now()

	// add newline and timestamp here
	syslogng.Printf(":%s,%s,%d,%s\n", category, tag, time.Now().UTC().Unix(), json)

	log.Debug("dlog tag:%s %s", tag, time.Since(this.t1))
	return nil
}