2012/3/28 Gelonida N <[email protected]>:
> On 03/28/2012 06:24 PM, Jeff Dyke wrote:
>> I use SocketHandler across multiple apps, not just by my uwsgi servers
>> and its handles the job perfectly, the added bene of all of my log files
>> being on one file system.  And all the code you need to build your own
>> is all online. I use this in conjunction with regular rotating file
>> handlers that are located on the local system, should i need that
>> flexibility.
>
>
> So far I made two attempts.
> Leightweight. Just log to the console and let uwsgi handle it.
> ----------------------------------------------------------------------
>
> This works not too bad. however sometimes I'd like to separate uwsgi
> logs and  python logs and this is a little tricky.
>
> If I could convince uwsgi to write stderr / stdout to separate files,
> then this could be good enough with following setup and wouldn't require
> an additional extra logging process.
>

Sorry for intervene. IMO gateway logging is gateway logging and
application logging is application logging.
I dont know how uwsgi handles logging by default: through master or
each process logging by itself. If later then you logging though
stdout isn't atomic. Btw you can use python default logging (not
atomic also). You can write you own logging handler that will do
locking (really bad bad solution) or flush or open log file with
O_DSYNC. You can write into separate files and merge them after, you
can log unto unix socket or syslog, even zeromq. There is a plenty of
options. It is a pity that there is no standard working out of box,
but dont see any reasons why uwsgi should care about application
logging.

> - python logging via stdout to one file
> - wsgi logging via stderr to another one
>
> What I didn't verify though is whether uwsgi would guarantee, that two
> logs of two porcesses wouldn't be interleafed.
> As long as each log line is complete this wouldn't matter. If logs could
> be mixed, I'd have to abandon this approach in any case.
>
>
> The log server approach
> --------------------------
>
> This seems to work and one of the advantages is, that I could log other
> processes as well.
> It just seems kind of a waste to have another process being active. I
> also encountered occasionally pickling exceptions when running some test
> code.
> I still have to investigate the source of this issue.
>
>
>
>
>>
>> On Wed, Mar 28, 2012 at 10:19 AM, Frank Jania
>> <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>>     You might check out http://pypi.python.org/pypi/ConcurrentLogHandler/
>>
>>
>>     Frank JANIA
>>     I solve problems.
>>
>>     _______________________________________________
>>     uWSGI mailing list
>>     [email protected]
>>     <mailto:[email protected]>
>>     http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>>
>>
>>
>>
>> _______________________________________________
>> uWSGI mailing list
>> [email protected]
>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi



-- 
--------------------------------------------
Турнаев Евгений Викторович
+7 906 875 09 43
--------------------------------------------
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to