List Info

Thread: changing config dynamically in 2.1.1




changing config dynamically in 2.1.1
country flaguser name
United States
2007-04-03 06:58:01
Hi - I have an app which up until now I have configured via
a file ...

cherrypy.config.update(file="cptestbedconf.conf")

... but I'd now like to dynamically amend the values set by
the file.
I've tried all sorts of things but I can't get the change to
take. One
thing that makes this a bit tricky is that the app is still
on CP
2.1.1

Below are some of the attempts ...

ATTEMPT 1:
dicSettings = {
                'global': {
                        'server.log_file':
"cpoCPServerLogFileDYNAMIC",
                }
}

cherrypy.config.update(dicSettings)

ATTEMPT2:
cherrypy.config.environments['production']['server.log_file'
] =
"cpoCPServerLogFileDynamic"

ATTEMPT3:
cherrypy.config.update({'global':{'server.log_file':
'cpoCPServerLogFileDYNAMIC'}})


Would any tell me what I'm doing wrong. When the application
starts
the logging is quite happily going to the location specified
in the
config file rather than being updated to use
cpoCPServerLogFileDYNAMIC.

Thanks

Richard.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: changing config dynamically in 2.1.1
user name
2007-04-03 07:08:48
On 4/3/07, northof40 <shearichardgmail.com> wrote:
>
> Hi - I have an app which up until now I have configured
via a file ...
>
>
cherrypy.config.update(file="cptestbedconf.conf")
>
> ... but I'd now like to dynamically amend the values
set by the file.
> I've tried all sorts of things but I can't get the
change to take. One
> thing that makes this a bit tricky is that the app is
still on CP
> 2.1.1
>
> Below are some of the attempts ...
>
> ATTEMPT 1:
> dicSettings = {
>                 'global': {
>                         'server.log_file':
> "cpoCPServerLogFileDYNAMIC",
>                 }
> }
>
> cherrypy.config.update(dicSettings)

Hi.  Looks like the problem is that you are using the wrong
configuration key to specify your log file.  It should not
be
server.log_file in 2.1.1.  It is server.logFile.

HTH,

Christian
http://www.dowski.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: changing config dynamically in 2.1.1
country flaguser name
United States
2007-04-03 07:51:03


On Apr 4, 12:08 am, "Christian Wyglendowski"
<christ...dowski.com>
wrote:
> On 4/3/07, northof40 <shearich...gmail.com> wrote:
>
>
>
>
>
> > Hi - I have an app which up until now I have
configured via a file ...
>
> >
cherrypy.config.update(file="cptestbedconf.conf")
>
> > ... but I'd now like to dynamically amend the
values set by the file.
> > I've tried all sorts of things but I can't get the
change to take. One
> > thing that makes this a bit tricky is that the app
is still on CP
> > 2.1.1
>
> > Below are some of the attempts ...
>
> > ATTEMPT 1:
> > dicSettings = {
> >                 'global': {
> >                         'server.log_file':
> > "cpoCPServerLogFileDYNAMIC",
> >                 }
> > }
>
> > cherrypy.config.update(dicSettings)
>
> Hi.  Looks like the problem is that you are using the
wrong
> configuration key to specify your log file.  It should
not be
> server.log_file in 2.1.1.  It is server.logFile.
>
> HTH,
>
> Christianhttp://www.dowski.com

That's really great, thanks. It works fine now.

regards

Richard.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )