mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
runtime: logging: Add variable for syslog tag
The variable for 'name' in config-settings.go.in was previously
hardcoded as "kata". In e7c42fb
it was changed to the runtime name,
which is "kata-runtime". Add a variable to specify a syslog identifier
for consistency for tests and documentation that use it.
Fixes #2806
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
This commit is contained in:
parent
06f4ab10b4
commit
3f95469a78
@ -20,6 +20,9 @@ import (
|
||||
var originalLoggerLevel = logrus.WarnLevel
|
||||
var kataUtilsLogger = logrus.NewEntry(logrus.New())
|
||||
|
||||
// SYSLOGTAG is for a consistently named syslog identifier
|
||||
const SYSLOGTAG = "kata"
|
||||
|
||||
// SetLogger sets the logger for the factory.
|
||||
func SetLogger(ctx context.Context, logger *logrus.Entry, level logrus.Level) {
|
||||
fields := logrus.Fields{
|
||||
@ -61,7 +64,7 @@ func (h *sysLogHook) Fire(e *logrus.Entry) (err error) {
|
||||
}
|
||||
|
||||
func newSystemLogHook(network, raddr string) (*sysLogHook, error) {
|
||||
hook, err := lSyslog.NewSyslogHook(network, raddr, syslog.LOG_INFO, NAME)
|
||||
hook, err := lSyslog.NewSyslogHook(network, raddr, syslog.LOG_INFO, SYSLOGTAG)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user