On Apr 20, 2010, at 7:02 PM, Paul Lathrop wrote:

I'm trying to add support for logging to Scribe. I *think* what I need
to do is the following:

* Add a "feature" that checks if the scribe gem is installed. (add a
file lib/puppet/feature/scribe.rb)
* Add configuration options for the scribe server, port, and category.
* Create a new Puppet::Util::Log.newdesttype block in
lib/puppet/util/log/destinations.rb

I am having trouble understanding a couple of things here, hoping for some help.

1) How do I add configuration options and access them in the
destination type declaration?
2) How do I connect the "feature" to the code declaring the
destination? I think I do something like: if Puppet.features.scribe? -
is there more to it than that?
3) Is there somewhere else I need to hook into to make this work?

Is this something you want to log to directly from the clients, or would it be suitable to have the server do the logging when it receives a report?

If the latter, then it's straightforward to write a report processor, or even report terminus, that does the work.

If the former, then yeah, you have the right plan.

As to your quesitons:

1) There isn't currently any way for plugins to add new defaults without some hackery. You'll essentially have to modify core Puppet code somewhere, either lib/puppet/defaults.rb, or another file that gets loaded by that file.

2) Yep, it's that easy.

3) You need to modify your executable to use your logdest. I think the logdest option stopped working a while ago, but if it works then it might be sufficient. Another option is to have your logdest value be complex, so you'd say something like 'puppetd --logdest scribe:servername:port'. Ugly, but meh. Note that logdest isn't a normal Puppet default, just an argument to puppetd.

--
The brain is a wonderful organ. It starts working the moment you get
up in the morning and does not stop until you get into the office.
    --Robert Frost
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to