python - py uses logging collection 2>&1 to output information
阿神
阿神 2017-06-22 11:51:26
0
2
976

As shown below, I want the normal output of logging to an empty file and the error output to server1.err. However, during actual operation, the normal output is also output to server1.err. How can I achieve this and only output the error log to in server1.err? ? ?

阿神
阿神

闭关修行中......

reply all(2)
習慣沉默

Did you use print for log output? If you use the logging module, you should not need to point to the output. You can point info and warning to different loggers

淡淡烟草味

You first try redirecting only errors and redirecting normally, instead of redirecting both at the same time, to see if the code is wrong.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!