这是我的场景:我想记录my_module的活动.根据执行的方法(比如INPUT和OUTPUT),这需要完成两个不同的文件.
所以我有两个处理程序,每个处理程序指向一个不同的文件(my_in_.log和my_out_.log),具有相同的日志级别.我想知道我是否可以使用相同的记录器来实现这一点,或者我必须定义两个记录器.我的配置是:
[loggers]
keys=root, my_log
[handlers]
keys=my_in_hand, my_out_hand
[formatters]
keys=generic_form
...
[logger_my_log]
level=NOTSET
handlers=my_in_hand, my_out_hand
qualname=ws_log
[handler_my_in_hand]
class=handlers.TimeRotatingFileHandler
level=NOTSET
formatter=generic_form
args=('my_in_.log', 'h', 1, 0, None, False, True)
[handler_my_out_hand]
class=handlers.TimeRotatingFileHandler
level=NOTSET
formatter=generic_form
args=('my_out_.log', 'h', 1, 0, None, False, True)
Run Code Online (Sandbox Code Playgroud)
我是否必须为每个处理程序/目标定义一个记录器?(因为我想在不同的文件中记录不同的信息)有没有办法向记录器指示哪个处理程序会这样做?我的意思是,我有一个记录器的两个处理程序,然后只选择一个处理程序来记录一个方法.
多谢!
我试图在Ubuntu 12.04系统中从Supervisor运行Gunicorn.Gunicorn运行Flask应用程序(使用Flask的嵌入式服务器测试简单的REST Web服务).我已经通过克隆GIT仓库安装了Gunicorn,试图避免'apt-get install',因为它在安装时运行Gunicorn服务器.我不希望它运行,它只由Supervisor运行.
所以在安装之后,如果我尝试:
cd /usr/local/bin
gunicorn my_app:app -c /path/to/gu_config_file
Run Code Online (Sandbox Code Playgroud)
Gunicorn工作.然后我杀了它.注意没有扩展名的配置文件,因为".py"扩展名对我不起作用.所以我编辑Supervisor的配置文件,如:
[program:gunicorn]
command=/usr/local/bin/gunicorn my_app:app -c /path/to/.gu_setup
directory=/usr/local/bin/
autostart=true
autorestart=true
redirect_stderr=True
Run Code Online (Sandbox Code Playgroud)
并更新Supervisor中的更改:
supervisorctl reread
# gunicorn: changed
supervisorctl update
# gunicorn: stopped
# gunicorn: updated process group
Run Code Online (Sandbox Code Playgroud)
检测文件中的更改并适用于Gunicorn程序.好的,但后来我尝试启动它:
supervisorctl start gunicorn
Run Code Online (Sandbox Code Playgroud)
变得讨厌:
gunicorn: ERROR (abnormal termination)
Run Code Online (Sandbox Code Playgroud)
检查主管的日志:
2013-03-08 13:07:22,378 INFO spawned: 'gunicorn' with pid 3355
2013-03-08 13:07:22,916 INFO exited: gunicorn (exit status 3; not expected)
2013-03-08 13:07:23,918 INFO spawned: 'gunicorn' with pid 3361
2013-03-08 13:07:24,492 INFO exited: gunicorn (exit status …
Run Code Online (Sandbox Code Playgroud) 我正在使用Liferay Portal 6.1.0 GA1
场景:配置portal-ext.properties之后:
locales=es_ES,en_US
time.zones=Europe/Paris
Run Code Online (Sandbox Code Playgroud)
运行服务器OK ...(只有那些语言和时区)
我想通过控制面板添加一种新语言 - >门户设置 - >显示设置,写入
es_ES,en_US,it_IT到可用的语言
但我得到:
Please enter a valid locale error.
Run Code Online (Sandbox Code Playgroud)
我也试图停止LR并编辑portal-ext.properties,但我得到了同样的结果.
你能帮助我吗?
多谢!阿尔贝托