Forum: NGINX How to use the gzip format for access_log in the new 1.3.10?

Posted by Lorenzo Raffio (Guest)
on 2012-12-26 00:17
(Received via mailing list)
Guys I updated from nginx 1.3.9 to 1.3.10, edited my access_log line and
here it is now:
*access_log /var/www/blahblah/logs/access.log gzip buffer=32k;*

Unfortunately when I restart nginx I get this error:
nginx: [emerg] unknown log format "gzip"

What am I doing wrong?

Thanks in advance.
Posted by Valentin V. Bartenev (Guest)
on 2012-12-26 00:25
(Received via mailing list)
On Wednesday 26 December 2012 03:16:51 Lorenzo Raffio wrote:
> Guys I updated from nginx 1.3.9 to 1.3.10, edited my access_log line and
> here it is now:
> *access_log /var/www/blahblah/logs/access.log gzip buffer=32k;*
>
> Unfortunately when I restart nginx I get this error:
> nginx: [emerg] unknown log format "gzip"
>
> What am I doing wrong?
>
> Thanks in advance.

You forgot to specify log format ("gzip" is not log format).

http://nginx.org/r/access_log
http://nginx.org/r/log_format

 wbr, Valentin V. Bartenev

--
http://nginx.com/support.html
http://nginx.org/en/donation.html
Posted by Lorenzo Raffio (Guest)
on 2012-12-26 01:26
(Received via mailing list)
Thanks Valentin!

*access_log /var/www/blahblah/logs/access.log combined gzip; worked :)*

**Last question: what does the flush variable do? Does it specify for
how much times to keep the logs?



2012/12/26 Lorenzo Raffio <multiformeingegno@gmail.com>
Posted by Lorenzo Raffio (Guest)
on 2012-12-26 01:28
(Received via mailing list)
Oh, I was forgetting: is there a way to globally set to gzip access_log?
Cause I have a lot of websites and it will be better to set this 
globally
instead of manually changing access_log line for every vhost :)


2012/12/26 Lorenzo Raffio <multiformeingegno@gmail.com>
Posted by Valentin V. Bartenev (Guest)
on 2012-12-26 08:45
(Received via mailing list)
On Wednesday 26 December 2012 04:26:17 Lorenzo Raffio wrote:
> Thanks Valentin!
>
> *access_log /var/www/blahblah/logs/access.log combined gzip; worked :)*
>
> **Last question: what does the flush variable do? Does it specify for
> how much times to keep the logs?
>

It specifies how long the log lines can be buffered.

See the docs: http://nginx.org/r/access_log

 wbr, Valentin V. Bartenev

--
http://nginx.com/support.html
http://nginx.org/en/donation.html
Posted by Valentin V. Bartenev (Guest)
on 2012-12-26 08:52
(Received via mailing list)
On Wednesday 26 December 2012 04:27:59 Lorenzo Raffio wrote:
> Oh, I was forgetting: is there a way to globally set to gzip access_log?
> Cause I have a lot of websites and it will be better to set this globally
> instead of manually changing access_log line for every vhost :)
>

This settings is set on a per file basis. If you want to change it for a 
lot of
access log files, you could use automated editing tools like sed, awk..

 wbr, Valentin V. Bartenev

--
http://nginx.com/support.html
http://nginx.org/en/donation.html
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.