-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add syslog #155
base: master
Are you sure you want to change the base?
Add syslog #155
Conversation
eventmon/monitord/api.go
Outdated
@@ -6,6 +6,7 @@ import ( | |||
"sync" | |||
|
|||
"github.com/Symantec/Dominator/lib/log" | |||
// "github.com/Symantec/keymaster/eventmon/tee_logger" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented-out lines.
@@ -26,6 +29,9 @@ const ( | |||
|
|||
var ( | |||
ErrorKeymasterDaemonNotReady = errors.New("keymasterd not ready") | |||
One = systeelogger.New() | |||
Two = nulllogger.New() //remain for the future use | |||
Teelog teelogger.Logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless these need to be exported, please make these private to the package.
@@ -37,6 +43,8 @@ func newMonitor(keymasterServerHostname string, keymasterServerPortNum uint, | |||
webLoginChannel := make(chan string, bufferLength) | |||
x509RawCertChannel := make(chan []byte, bufferLength) | |||
x509CertChannel := make(chan *x509.Certificate, bufferLength) | |||
Teelog := teelogger.New(One, Two) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's cleaner to create the two loggers here and then create the teelogger.
@@ -37,6 +43,8 @@ func newMonitor(keymasterServerHostname string, keymasterServerPortNum uint, | |||
webLoginChannel := make(chan string, bufferLength) | |||
x509RawCertChannel := make(chan []byte, bufferLength) | |||
x509CertChannel := make(chan *x509.Certificate, bufferLength) | |||
Teelog := teelogger.New(One, Two) | |||
defer One.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will cause system logging to fail once you return from this function.
@@ -59,7 +67,7 @@ func newMonitor(keymasterServerHostname string, keymasterServerPortNum uint, | |||
X509CertChannel: x509CertChannel, | |||
keymasterStatus: make(map[string]error), | |||
} | |||
go monitor.monitorForever(logger) | |||
go monitor.monitorForever(logger, Teelog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you adding a second logger parameter? I was expecting that the teelogger would replace the logger in the parameter list.
What is the goal? To send all logs to both loggers? Or is that not the case?
@@ -0,0 +1,39 @@ | |||
package systeelogger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a teelogger. I suggest calling this package "syslogger".
|
||
const ( | ||
priority = syslog.LOG_AUTHPRIV | ||
log_name = "keymaster" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these should be passed in when creating the syslogger.
@cviecco: Please also take a look. |
No description provided.