9 More Discussions You Might Find Interesting
1. Windows & DOS: Issues & Discussions
Hi Team,
My new build configuration always looking for the files from the build where i copied from.
please help me to resolve this.
I am using Visual studio 2008.It has Qt 4.8. plugins,qml,C++ development
I created new debug_new build configuration with additional preprocessor from the... (1 Reply)
Discussion started by: SA_Palani
1 Replies
2. Shell Programming and Scripting
Hi,
Having trouble in our network we would like to implement a second "ip-helper" (to have DHCP redondancy) to do so we have to take all the network elements config (switches and routers) , finds where the particular config is and add a second line. To do so we need to have a list where this... (1 Reply)
Discussion started by: Philalapatte
1 Replies
3. Shell Programming and Scripting
(copied directly from my other thread about something else)
At the moment, I just use...
cat config_file|grep var_name|cut -d'=' -f2
... which is fine for what I've been doing, but I'm not sure what to
do when there are a variable number of entries and I want it go through
them like a... (7 Replies)
Discussion started by: ninjaaron
7 Replies
4. UNIX for Advanced & Expert Users
Hi All,
I'm bit confused with a script
Any help would be appreciated
I have a config file say config.cfg and iam loading config file in My_Script.sh..The script name is My_Script.sh.
My_Script.sh and config.cfg are in same directory...My_Script.sh is run on the crontab
50 01 * * * &&... (2 Replies)
Discussion started by: selvam
2 Replies
5. Shell Programming and Scripting
Hi,
I have 2 perl SubRoutines (sub 1 and sub 2). I created two perl modules for these (Sub1.pm and Sub2.pm).
How can I include these in a config file (say Config.cfg) and call the config file in my main script Rename.pl to use the 2 subroutines?
Right now here are the content of Config.cfg... (1 Reply)
Discussion started by: CCFP
1 Replies
6. Shell Programming and Scripting
Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated.
script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made.
OS :Susi linux ver 10.3.
... (4 Replies)
Discussion started by: muraliinfy04
4 Replies
7. Shell Programming and Scripting
Hi,
I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below.
I will be using the config file as mentioned below:
(config.txt)
country:a,b
city:1,2
type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies
8. UNIX for Dummies Questions & Answers
Currently our Apache log files are huge, I want to put say a month's time limit on this, then when it hits the end of the month I would like it to start over writing.
Does anyone know where the config file is for this and what its called? I also want to do exactly the same on wtmp config (who... (1 Reply)
Discussion started by: Webwitch
1 Replies
9. UNIX for Dummies Questions & Answers
We just moved to a new office so few things changed on our LAN. I am on Solaris and trying to find the files that hold the configuration for connecting to the servers. I changed the IP addresses to reflect the new addresses but still I get this error:
“unknown sendmail : unable to qualify my own... (3 Replies)
Discussion started by: softarch
3 Replies
Log::Dispatch::Configurator::Any(3pm) User Contributed Perl Documentation Log::Dispatch::Configurator::Any(3pm)
NAME
Log::Dispatch::Configurator::Any - Configurator implementation with Config::Any
VERSION
version 1.110690
SYNOPSIS
In the traditional Log::Dispatch::Config way:
use Log::Dispatch::Config; # loads Log::Dispatch
use Log::Dispatch::Configurator::Any;
my $config = Log::Dispatch::Configurator::Any->new('log.yml');
Log::Dispatch::Config->configure($config);
# nearby piece of code
my $log = Log::Dispatch::Config->instance;
$log->alert('Hello, world!');
Alternatively, without a config file on disk:
use Log::Dispatch::Config; # loads Log::Dispatch
use Log::Dispatch::Configurator::Any;
my $confhash = {
dispatchers => ['screen]',
screen = {
class => 'Log::Dispatch::Screen',
min_level => 'debug',
},
};
my $config = Log::Dispatch::Configurator::Any->new($confhash);
Log::Dispatch::Config->configure($config);
# nearby piece of code
my $log = Log::Dispatch::Config->instance;
$log->alert('Hello, world!');
DESCRIPTION
Log::Dispatch::Config is a wrapper for Log::Dispatch and provides a way to configure Log::Dispatch objects with configuration files.
Somewhat like a lite version of log4j and Log::Log4perl it allows multiple log destinations. The standard configuration file format for
Log::Dispatch::Config is AppConfig.
This module plugs in to Log::Dispatch::Config and allows the use of other file formats, in fact any format supported by the Config::Any
module. As a bonus you can also pass in a configuration data structure instead of a file name.
PURPOSE
Use this module in combination with Log::Dispatch::Config to allow many formats of configuration file to be loaded, via the Config::Any
module.
USAGE
Follow the examples in the "SYNOPSIS". If you are using an external configuration file, be aware that you are required to use a filename
extension (e.g. ".yml" for YAML).
Below are a couple of tips and tricks you may find useful.
Fall-back default config
Being able to use a configuration data structre instead of a file on disk is handy when you want to provide application defaults which the
user then replaces with their own settings. For example you could have the following:
my $defaults = {
dispatchers => ['screen'],
screen => {
class => 'Log::Dispatch::Screen',
min_level => 'debug',
},
};
my $config_file = '/etc/myapp_logging.conf';
my $config = $ENV{MYAPP_LOGGING_CONFIG} || $ARGV[0] ||
( -e $config_file ? $config_file : $defaults);
Log::Dispatch::Config->configure_and_watch(
Log::Dispatch::Configurator::Any->new($config) );
my $dispatcher = Log::Dispatch::Config->instance;
With the above code, your application will check for a filename in an environment variable, then a filename as a command line argument,
then check for a file on disk, and finally use its built-in defaults.
Dealing with a "dispatchers" list
Log::Dispatch::Config requires that a global setting "dispatchers" have a list value (i.e. your list of dispatchers). A few config file
formats do not support list values at all, or list values at the global level (two examples being Config::Tiny and Config::General).
This module allows you to have a small grace when there is only one dispatcher in use. Write the configuration file normally, and the
single-item "dispatchers" value will automatically be promoted to a list. In other words:
# myapp.ini
dispatchers = screen
# this becomes a config of:
$config = { dispatchers => 'screen', ... };
# so this module promotes it to:
$config = { dispatchers => ['screen'], ... };
If you want more than one dispatcher, you then need to use a config file format which supports these lists natively, I'm afraid. A good
suggestion might be YAML.
THANKS
My thanks to "miyagawa" for writing Log::Dispatch::Config, from where I also took some tests. Also thanks to Florian Merges for his YAML
Configurator, which was a useful example and saved me much time.
AUTHOR
Oliver Gorwits <oliver@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by University of Oxford.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2011-03-10 Log::Dispatch::Configurator::Any(3pm)