Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python日志记录不适用于使用google应用程序引擎的web应用程序_Python_Google App Engine_Logging - Fatal编程技术网

python日志记录不适用于使用google应用程序引擎的web应用程序

python日志记录不适用于使用google应用程序引擎的web应用程序,python,google-app-engine,logging,Python,Google App Engine,Logging,我有一个使用谷歌应用程序引擎的web应用程序。在ubuntu中,我使用 ./dev_appserver.py /home/me/dev/mycode 在mycode文件夹中,我有app.yml和web应用的python文件 import logging LOG_FILENAME = '/home/me/logs/mylog.txt' logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG) class Handler(we

我有一个使用谷歌应用程序引擎的web应用程序。在ubuntu中,我使用

./dev_appserver.py /home/me/dev/mycode
在mycode文件夹中,我有app.yml和web应用的python文件

import logging
LOG_FILENAME = '/home/me/logs/mylog.txt'
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)


class Handler(webapp2.RequestHandler):
    ....

class Welcome(Handler):
    def get(self):
        if self.user:
            logging.debug('rendering welcome page for user')            
            self.render('welcome.html',username= self.user.name)
        else:
            logging.debug('redirect to signup')            
            self.redirect('/signup')
class MainPage(Handler):
        def get(self):
            self.redirect('/welcome')
app = webapp2.WSGIApplication([('/', MainPage),('/signup', Register),('/welcome', Welcome)], debug=True)
我已经为logs目录设置了
chmod 777
。仍然没有在那里创建日志。我不知道当google app engine运行时如何查看日志。因为它在linux中,我没有带有gui的
启动器。
。这使得如果生成了应用引擎日志,就很难查看


如果有人能帮我解决这个问题,那就太好了。

你读过这篇文章吗,因为我知道你不能声明你自己的日志文件。

你读过这篇文章吗,因为我知道你不能声明你自己的日志文件。

我有相同的环境(Ubuntu、python、gae),并且在日志记录方面遇到了类似的问题

您不能按此处所述登录到本地文件:

“沙盒确保应用程序只能执行不会干扰其他应用程序的性能和可扩展性的操作。例如,应用程序无法将数据写入本地文件系统或进行任意网络连接。”

开发服务器在本地计算机上运行应用程序以测试应用程序。服务器模拟应用程序引擎数据存储、服务和沙盒限制

我能够按如下方式使控制台日志记录工作:

import logging
logging.getLogger().setLevel(logging.DEBUG)

我有相同的环境(Ubuntu、python、gae),在日志记录方面遇到了类似的问题

您不能按此处所述登录到本地文件:

“沙盒确保应用程序只能执行不会干扰其他应用程序的性能和可扩展性的操作。例如,应用程序无法将数据写入本地文件系统或进行任意网络连接。”

开发服务器在本地计算机上运行应用程序以测试应用程序。服务器模拟应用程序引擎数据存储、服务和沙盒限制

我能够按如下方式使控制台日志记录工作:

import logging
logging.getLogger().setLevel(logging.DEBUG)