> Hi,
>
> I want to have the date of the logs of the stdout made from the
> application, I already have disabled the logs of uwsgi, so, the only
> entries beside the initialization logs of uwsgi are the messages
> printed to stdout from the application, but this logs have no date on
> it.
>
> I just want to add the date, I thought that using logdate would
> happen, but it seems it only works for uwsgi logs.
>
> I know that I can play redirecting sys.stdout to a stream-like
> instance with wirte method defined on the init module for my
> application, but I will like to avoid that.
>
> Bye.
>
>
messages sent to stdout/stderr are only mapped to the logfile, they are
not real logs. You may want to use syslog as it will blindly prepend dates
to each message line, or develop a 7 line udp/unix logger doing the same:
#!/usr/bin/ruby
require 'socket'
s = UDPSocket.new
s.bind('127.0.0.1', 1234)
loop do
text, sender = s.recvfrom(4096)
puts "#{Time.now} - #{text}"
end
uwsgi --log-socket 127.0.0.1:1234 ...
#!/usr/bin/perl
use IO::Socket::UNIX;
unlink("/tmp/logger");
my $server = IO::Socket::UNIX->new(Local => "/tmp/logger", Type =>
SOCK_DGRAM);
while(1) {
$server->recv(my $logline, 4096);
print localtime.' - '.$logline;
}
uwsgi --log-socket /tmp/logger ...
--
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi