-
Notifications
You must be signed in to change notification settings - Fork 157
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
Issue 11 #78
base: master
Are you sure you want to change the base?
Issue 11 #78
Conversation
self.DestPort = config.Destination.Port | ||
self.Protocol = config.Destination.Protocol | ||
self.Hostname = config.Hostname | ||
self.RefreshInterval = config.RefreshInterval |
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 added a logging statement into main that prints out config.RefreshInterval
and get:
2015-06-30 21:37:05 ERROR remote_syslog.go:23 RefreshInterval: 30ns
Adding another logging statement into SetYAML suggests it never gets called. I think we're using a slightly different version of the YAML lib, but in case it's useful, this comment is present in the current src.
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 was the config:
files:
- /home/leon/test.log
destination:
host: HOST.papertrailapp.com
port: PORT
protocol: tls
new_file_check_interval: 30
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 will expand the config test to include checking loaded values. It only ensures the CLI overrides are working correctly now.
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.
Fixed
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.
Thanks!
} | ||
|
||
func (self *Config) override() error { | ||
configfile := pflag.StringP("configfile", "c", DEFAULT_CONFIG_FILE, "Path to config") |
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.
Heh, this is an interesting one. The configfile
switch won't do anything because we've already loaded the config.
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.
Useful later, perhaps, when we support sending the -HUP signal?
On Wed, Jul 1, 2015 at 10:42 PM Leon Sodhi [email protected] wrote:
In config.go
#78 (comment)
:
- if err = yaml.Unmarshal(file, &config); err != nil {
return fmt.Errorf("Could not parse the config file: %s", err)
- }
- self.Files = config.Files
- self.DestHost = config.Destination.Host
- self.DestPort = config.Destination.Port
- self.Protocol = config.Destination.Protocol
- self.Hostname = config.Hostname
- self.RefreshInterval = config.RefreshInterval
- self.ExcludeFiles = config.ExcludeFiles
- self.ExcludePatterns = config.ExcludePatterns
- return nil
+}
+func (self *Config) override() error {
- configfile := pflag.StringP("configfile", "c", DEFAULT_CONFIG_FILE, "Path to config")
Heh, this is an interesting one. The configfile switch won't do anything
because we've already loaded the config.—
Reply to this email directly or view it on GitHub
https://github.com/papertrail/remote_syslog2/pull/78/files#r33722036.
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 definitely something we'll have to fix before merging. Many customers have manually specified a config file location in production environments, particularly when running multiple instances of r_s2 with different hostnames. We also use it in our example init.d script.
Oh, yeah, this resolves issue #11 |
No description provided.