# Logging

**URL:** <https://www.ruby-forum.com/t/logging/243787>\
**Category:** NGINX\
**Created:** [January 6, 2016, 3:12pm UTC](https://www.ruby-forum.com/t/logging/243787 "2016-01-06T15:12:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [January 6, 2016, 3:12pm UTC](https://www.ruby-forum.com/t/logging/243787/1 "2016-01-06T15:12:09Z")

</div>

Is it possible to log websocket requests in nginx access log ? Or is  
this  
logging restricted only to http requests ?  
tammini

Posted at Nginx Forum:

> **[logging](https://forum.nginx.org/read.php?2,263878,263878#msg-263878)**
>
> Is it possible to log websocket requests in nginx access log ? Or is this logging restricted only to http requests ? tammini

---

<div class="post-metadata">

**Author:** ![tammini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/898d66/32.png) [@tammini](https://www.ruby-forum.com/u/tammini)\
**Post date:** [January 8, 2016, 6:27pm UTC](https://www.ruby-forum.com/t/logging/243787/2 "2016-01-08T18:27:17Z")

</div>

Hello!

On Wed, Jan 06, 2016 at 09:11:54AM -0500, tammini wrote:

> Is it possible to log websocket requests in nginx access log ? Or is this  
> logging restricted only to http requests ?

WebSocket requests are no different from other HTTP requests -  
they just establish a WebSocket connection using the Upgrade HTTP  
mechanism. They are logged to access logs much like other HTTP  
requests once the WebSocket connection is closed.

Note though that it’s not possible to log what happens inside a  
WebSocket connection.

–  
Maxim D.

> **[nginx](http://nginx.org/)**

---

<div class="post-metadata">

**Author:** ![tammini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/898d66/32.png) [@tammini](https://www.ruby-forum.com/u/tammini)\
**Post date:** [January 12, 2016, 5:22am UTC](https://www.ruby-forum.com/t/logging/243787/3 "2016-01-12T05:22:00Z")

</div>

Does that mean once a websocket connection is opened successfully, any  
subsequent requests sent on that connection cannot be logged ?

Thanks.

Posted at Nginx Forum:

> **[Re: logging](https://forum.nginx.org/read.php?2,263878,263938#msg-263938)**
>
> Is it possible to log websocket requests in nginx access log ? Or is this logging restricted only to http requests ? tammini

---

<div class="post-metadata">

**Author:** ![tammini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/898d66/32.png) [@tammini](https://www.ruby-forum.com/u/tammini)\
**Post date:** [January 12, 2016, 6:50am UTC](https://www.ruby-forum.com/t/logging/243787/4 "2016-01-12T06:50:13Z")

</div>

Only time you see a log for a web socket connection is when it get  
disconnected. So you will not see a log when it connects, transfer data  
over it.

On Mon, Jan 11, 2016 at 8:21 PM, tammini [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![tammini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/898d66/32.png) [@tammini](https://www.ruby-forum.com/u/tammini)\
**Post date:** [January 12, 2016, 1:56pm UTC](https://www.ruby-forum.com/t/logging/243787/5 "2016-01-12T13:56:05Z")

</div>

Hello!

On Mon, Jan 11, 2016 at 11:21:35PM -0500, tammini wrote:

> Does that mean once a websocket connection is opened successfully, any  
> subsequent requests sent on that connection cannot be logged ?

No HTTP requests can be sent into a connection which was upgraded  
to a WebSocket connection. It’s a one way operation. Anything  
inside a websocket connection happens more or less as a body of  
the HTTP request (and the response).

(Note well that there are no requests inside WebSocket connections.  
WebSockets use frames to ensure data delivery, and doesn’t specify  
anything else. And, as previously said, nginx doesn’t try to parse  
and/or log anything inside WebSocket connections.)

–  
Maxim D.

> **[nginx](http://nginx.org/)**
