[collectd] how to get log messages only on stdout not in file ?

Sebastian Harl sh at tokkee.org
Thu Mar 13 14:58:31 CET 2008


Hi Dieter,

On Thu, Mar 13, 2008 at 02:30:26PM +0100, Dieter Bloms wrote:
> I've configured the logfile plugin like this:
> 
> <Plugin logfile>
>   LogLevel debug
>   File STDOUT
> </Plugin>
> 
> but collectd tries to write logstuff to /var/log/collectd.log.
> In my case it doesn't have permissions to do so and I see many messages
> like:
> 
> logfile plugin: fopen (/var/log/collectd.log) failed: Permission denied
> logfile plugin: fopen (/var/log/collectd.log) failed: Permission denied
> logfile plugin: fopen (/var/log/collectd.log) failed: Permission denied
> logfile plugin: fopen (/var/log/collectd.log) failed: Permission denied
> logfile plugin: fopen (/var/log/collectd.log) failed: Permission denied
> 
> Is it possible to configure the logfile plugin to _not_ write to a file,
> but only write to stdout ?

By default, the "logfile" plugin writes to a file. The plugin is
activated (with the default settings) as soon as the appropriate
"LoadPlugin" line of the config file has been parsed. So, any messages
that are logged before the "<Plugin logfile>" block has been parsed are
written to the file.

To work around that, you can place the "<Plugin logfile>" block right
after the "LoadPlugin logfile" line.

Now, the question arises, if this should somehow be handled by collectd.
This could be achieved by parsing all of the config file before loading
or activating any plugins. Imho there is no real need to have any
side-effects while parsing the config file. Any thoughts? Florian?

HTH,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080313/3c76750f/attachment.pgp 


More information about the collectd mailing list