Tornado logs

78 views
Skip to first unread message

Алексей Силк

unread,
Mar 30, 2013, 11:34:06 PM3/30/13
to python-...@googlegroups.com
Hello!


Prevoiusly I used logs path like thet ...

    # if linux then log
    if os.name == "posix":
        print str(serverPort)
        tornado.options.options['log_file_prefix'].set('/var/log/tornado/cloudftps/'+str(serverPort)+'.log')
    tornado.options.parse_command_line()

for now it gives me an error ... 

  File "C:\Users\rootiks\YandexDisk\py\myftpbackup\cloudftps.py", line 168, in startServer
    tornado.options.options['log_file_prefix'].set('c:/'+str(serverPort)+'.log')
TypeError: 'OptionParser' object has no attribute '__getitem__'


Lysander Trischler

unread,
Mar 31, 2013, 3:27:25 AM3/31/13
to python-...@googlegroups.com
Hi,

I recommend reading the entire change log. There are quite a lot of things
which were added or changed.


> tornado.options.options['log_file_prefix'].set('/var/log/tornado/cloudftps/
> '+str(serverPort)+'.log') tornado.options.parse_command_line()
>
> for now it gives me an error ...
> […]
> tornado.options.options['log_file_prefix'].set('c:/'+str(serverPort)+'.log'
> ) TypeError: 'OptionParser' object has no attribute '__getitem__'

You must use options.log_file_prefix in attribute style to access the desired
configuration value, because it's no dict anymore. See the docs:

http://www.tornadoweb.org/en/stable/releases/v3.0.0.html#tornado-options

Ben, I think this particular issue should be mentioned in the changelog
section "Backwards-incompatible changes", too.

Regards,
Lyse

Ben Darnell

unread,
Mar 31, 2013, 5:42:12 PM3/31/13
to Tornado Mailing List
On Sun, Mar 31, 2013 at 3:27 AM, Lysander Trischler <goo...@lyse.isobeef.org> wrote:
You must use options.log_file_prefix in attribute style to access the desired
configuration value, because it's no dict anymore. See the docs:

http://www.tornadoweb.org/en/stable/releases/v3.0.0.html#tornado-options

Ben, I think this particular issue should be mentioned in the changelog
section "Backwards-incompatible changes", too.

Yeah, you're probably right.  I left it out because the dict-style access was never documented (and had some inconsistent behavior), but I suppose people might have stumbled across it.  

-Ben
 

Regards,
Lyse

--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornad...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages