# How to use the gzip format for access\_log in the new 1.3.10?

**URL:** <https://www.ruby-forum.com/t/how-to-use-the-gzip-format-for-access-log-in-the-new-1-3-10/225273>\
**Category:** NGINX\
**Created:** [December 26, 2012, 12:17am UTC](https://www.ruby-forum.com/t/how-to-use-the-gzip-format-for-access-log-in-the-new-1-3-10/225273 "2012-12-26T00:17:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [December 26, 2012, 12:17am UTC](https://www.ruby-forum.com/t/how-to-use-the-gzip-format-for-access-log-in-the-new-1-3-10/225273/1 "2012-12-26T00:17:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lorenzo\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@lorenzo\_r](https://www.ruby-forum.com/u/lorenzo_r)\
**Post date:** [December 26, 2012, 12:25am UTC](https://www.ruby-forum.com/t/how-to-use-the-gzip-format-for-access-log-in-the-new-1-3-10/225273/2 "2012-12-26T00:25:25Z")

</div>

On Wednesday 26 December 2012 03:16:51 Lorenzo R. 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/access_log)  
[http://nginx.org/r/log\_format](http://nginx.org/r/log_format)

wbr, Valentin V. Bartenev

–

> **[Technical Support for NGINX and NGINX Plus Software](https://www.nginx.com/support/)**
>
> Get the help you need with support directly from the authors and maintainers of NGINX Open Source and NGINX Plus.

[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![lorenzo\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@lorenzo\_r](https://www.ruby-forum.com/u/lorenzo_r)\
**Post date:** [December 26, 2012, 1:26am UTC](https://www.ruby-forum.com/t/how-to-use-the-gzip-format-for-access-log-in-the-new-1-3-10/225273/3 "2012-12-26T01:26:55Z")

</div>

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 R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![lorenzo\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@lorenzo\_r](https://www.ruby-forum.com/u/lorenzo_r)\
**Post date:** [December 26, 2012, 1:28am UTC](https://www.ruby-forum.com/t/how-to-use-the-gzip-format-for-access-log-in-the-new-1-3-10/225273/4 "2012-12-26T01:28:40Z")

</div>

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 R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![lorenzo\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@lorenzo\_r](https://www.ruby-forum.com/u/lorenzo_r)\
**Post date:** [December 26, 2012, 8:45am UTC](https://www.ruby-forum.com/t/how-to-use-the-gzip-format-for-access-log-in-the-new-1-3-10/225273/5 "2012-12-26T08:45:41Z")

</div>

On Wednesday 26 December 2012 04:26:17 Lorenzo R. 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: [Module ngx\_http\_log\_module](http://nginx.org/r/access_log)

wbr, Valentin V. Bartenev

–

> **[Technical Support for NGINX and NGINX Plus Software](https://www.nginx.com/support/)**
>
> Get the help you need with support directly from the authors and maintainers of NGINX Open Source and NGINX Plus.

[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![lorenzo\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@lorenzo\_r](https://www.ruby-forum.com/u/lorenzo_r)\
**Post date:** [December 26, 2012, 8:52am UTC](https://www.ruby-forum.com/t/how-to-use-the-gzip-format-for-access-log-in-the-new-1-3-10/225273/6 "2012-12-26T08:52:07Z")

</div>

On Wednesday 26 December 2012 04:27:59 Lorenzo R. 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

–

> **[Technical Support for NGINX and NGINX Plus Software](https://www.nginx.com/support/)**
>
> Get the help you need with support directly from the authors and maintainers of NGINX Open Source and NGINX Plus.

[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)
