in reply to using env vars in Log::Dispatch::Config config files

Grafne:

print "$_:'$ENV{$_}'\n" for sort keys %ENV;

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: using env vars in Log::Dispatch::Config config files
by Grafne (Initiate) on Jun 22, 2012 at 14:40 UTC

    I am not sure what you mean?

    The data is stored in a config file. I could override this in my perl to over write the values in Log::Dispatch::Config->instance()->{'outputs'}->{'file'}->{'filename'} but this defeats the point of using the file. The intention is to allow users to edit the logger.conf file to change settings rather than having them hard coded.

    I am looking for a method of telling the log::dispatch::Config to use the env var to set the filename. I was hoping that the value read back from the file would be expanded when read and take the value of $HOST but instead the string is returned and I create a file called $host.log.

      Grafne:

      My bad. I interpreted your post as a "I can't get the environment variable" and I was showing how to access the environment variable hash. I didn't notice the part of your post when you're talking about reading it from a file. (I had thought that was a bit of the code you were having trouble with.)

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.