Comments (11)
收到,我看下,谢谢
from aliyun-log-python-sdk.
@007gzs 目前添加了一个新的类UwsgiQueuedLogHandler
以便解决线程进程模型问题. 不过这个类需要额外安装一个第三方库uwsgidecorators
, SDK并没有默认安装.
https://aliyun-log-python-sdk.readthedocs.io/api.html#aliyun.log.UwsgiQueuedLogHandler
另外, 请注意, 目前添加了2个新功能, 可以在写Log的时候, 自动解析JSON和KV, 你可以参考如下文章简单配置即可:
from aliyun-log-python-sdk.
不好意思,换工作了,新公司没用sls
from aliyun-log-python-sdk.
收到, 那我先关闭了.
from aliyun-log-python-sdk.
@wjo1212 启动无报错,但是日志发送不到阿里云
from aliyun-log-python-sdk.
@zhanghaofei 配置的AK和Endpoint以及当时的网络是OK的吗?可以先在同样环境下用一个普通程序验证一下?如果是对的,请问用的哪种uwsgi用的哪种环境部署和版本的(操作系统、Web服务器版本)?具体配置参数如何?对应的Python版本?
我这里重现一下,谢谢
from aliyun-log-python-sdk.
我刚试了下,好像也不行。
log配置
'alilog': {
'level': 'DEBUG',
# 'class': 'aliyun.log.logger_hanlder.UwsgiQueuedLogHandler',
'class': 'aliyun.log.logger_hanlder.SimpleLogHandler',
'end_point': local_settings.SLS_END_POINT,
'access_key_id': local_settings.SLS_ACCESS_KEY_ID,
'access_key': local_settings.SLS_ACCESS_KEY_SECRET,
'project': local_settings.SLS_PROJECT,
'log_store': local_settings.SLS_LOG_STORE,
}
'django.db': {
'handlers': ['alilog', ],
'level': 'DEBUG',
'propagate': False,
},
uwsgi配置
[uwsgi]
uwsgi-socket=:9090
env = IS_ADMIN=1
chdir=/opt/python/hb2c-django/
module=hb2c.wsgi:application
master=True
processes=4
harakiri=30
pidfile=/opt/config/uwsgi.pid
touch-reload=/opt/config/uwsgi.reload
vacuum=True
max-requests=1000
enable-threads=True
virtualenv = /virtualenv/hb2c
daemonize=/dev/null
#daemonize=/var/log/uwsgi.log
enable-threads=True
reload-on-rss=240
reload-mercy=60
max-worker-lifetime=3600
post-buffering=262144
post-buffering-bufsize=262144
http-socket=:9091
http-websockets=True
gevent=1000
依赖版本
aliyun-log-python-sdk==0.6.30.1
aliyun-python-sdk-core-v3==2.8.5
aliyun-python-sdk-dysmsapi==1.0.0
amqp==2.2.2
billiard==3.5.0.3
celery==4.1.0
certifi==2018.4.16
chardet==3.0.4
crcmod==1.7
diff-match-patch==20121119
Django==1.11.12
django-constance==2.2.0
django-grappelli==2.11.1
django-import-export==1.0.0
django-redis-cache==1.7.1
django-redis-sessions==0.6.1
django-restframework-apiview==1.2.21
djangorestframework==3.8.2
enum34==1.1.6
et-xmlfile==1.0.1
gevent==1.2.2
greenlet==0.4.13
hiredis==0.2.0
idna==2.6
jdcal==1.4
kombu==4.1.0
odfpy==1.3.6
openpyxl==2.5.2
optionaldict==0.1.1
oss2==2.4.0
Pillow==5.0.0
protobuf==3.5.2.post1
pycryptodome==3.5.1
PyMySQL==0.8.0
python-dateutil==2.7.3
pytz==2018.4
PyYAML==3.12
redis==2.10.6
requests==2.18.4
six==1.11.0
tablib==0.12.1
unicodecsv==0.14.1
urllib3==1.22
uWSGI==2.0.17
uwsgidecorators==1.1.0
vine==1.1.4
wechatpy==1.7.0
xlrd==1.1.0
xlwt==1.3.0
xmltodict==0.11.0
from aliyun-log-python-sdk.
uwsgidecorators 里的 import uwsgi 是哪个依赖包啊,装了uWSGI,site-packages里没有 uwsgi
>>> import uwsgidecorators
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/virtualenv/hb2c/lib/python3.5/site-packages/uwsgidecorators.py", line 10, in <module>
import uwsgi
ImportError: No module named 'uwsgi'
from aliyun-log-python-sdk.
今天来又试可以发送了,但是中间会又丢失日志,例如连续产生三条日志,日志文件中已经看到三条日志,但是阿里云只采集到了两条,少了一条,频繁出现
from aliyun-log-python-sdk.
收到,我看下,谢谢
from aliyun-log-python-sdk.
@zhanghaofei 不好意思,最近才恢复,看了下,似乎在未退出时并不会有数据丢失,主要是supervisor直接kill的时候,Handler无法捕获到退出信息,因此可能会丢失。目前改进了发送机制,最小100毫秒发送出去,因此丢失几率下降。后续可能会做一个简单的redo-log来放置丢失。
烦请试下最新master看看问题改进如何。后续CI过了,我会上传到PYPI
from aliyun-log-python-sdk.
Related Issues (20)
- QueuedLogHandler worker 终止条件问题 HOT 5
- uwsgi多进程下无法采集日志 HOT 2
- 是否支持从Oss导入数据
- IndexLineConfig的from_json方法的chn字段无效
- logging handler支持修改特定日志的topic
- 文档 拉取(Pull)数据 里面有错误 HOT 1
- 如果屏蔽默认上传的值 HOT 1
- fix typo in filename: logger_han*ld*er.py to logger_han*dl*er.py
- 无法使用GetLogRequest中的query去拉取__source__的数据
- How to get a total count HOT 1
- max_fetch_log_group_size 参数作用缺失,导致大数据下内存暴涨 HOT 1
- python2.7 在21年之后不再维护,直接pip install安装失败,dateparser要求python 版本高于3.5? HOT 1
- QueuedLogHandler中针对flush的重写不应该杀掉worker线程 HOT 1
- uwsgi模式下UwsgiQueuedLogHandler不能采集日志,而QueuedLogHandler可以 HOT 1
- how to overwrite the `funcName` of current environment?
- Gunicorn + Unicorn + Fastapi, QueuedLogHandler的worker中的queue一直为空 HOT 3
- Package doesn't work with protobuf 4.21.0 HOT 2
- [IDEA] Can we get a full example for Aliyun OSS with fastAPI? HOT 2
- 已安装pandas和ipywidgets,但无法使用 Jupyter notebook 增强功能
- 保存日志报错: TypeError has type float, but expected one of: bytes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliyun-log-python-sdk.