[Libwebsockets] What is the proper way to create log file using libuv and lws ?

Andy Green andy at warmcat.com
Mon Jul 25 18:49:22 CEST 2016

On July 25, 2016 11:55:04 PM GMT+08:00, Meir Yanovich <meiry242 at gmail.com> wrote:
>Hello all
>I need to log all my request/response to log file .
>based on the libuv example alone :
>although this doesn't work , what is the right way to do it ?

I couldn't get what you are asking from this and the link.

You're asking how to direct all lws logs to libuv logging?

 - You can set lws logging to use a custom emit callback with lws_set_log_level() that can do what you like.

"request/response" of what, network serving or filesystem?

 - You can get Apache-compatible server logging with LWS_WITH_ACCESS_LOG.

 - Filesystem accesses by lws itself go through an ops struct you can hook, see struct lws_plat_file_ops in libwebsockets.h and test-server.c for example how to hook.

None of the above?  Please explain in more detail what you're trying to do and what "doesn't work".


>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list