企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## syslog.Dial ``` sysLog, err := syslog.Dial("", "", syslog.LOG_ERR, "go program") if err != nil { log.Fatal(err) } defer sysLog.Close() sysLog.Emerg("Hello world!") // Dec 27 14:23:20 mbp go program[26840]: Hello world! sysLog.Info("hello info") sysLog.Crit("hello Crit") // Dec 27 14:26:46 mbp go program[27251]: hello Crit sysLog.Alert("hello Alert") sysLog.Debug("hello debuig") ``` 把日志写入系统的 `/var/log/system.log`