New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functionality: log messages to a file ? #167
Comments
To that I need to remove each #ifdef NDEBUG in the source code. |
Logging is indeed important, but it has to be done carefully as to not impact performance that much. I've been postponing this since the project started since I haven't found yet a way I'm comfortable with. Do you have anything in mind? |
Hm, I'm not sure if I like Lwan writing directly to a file. I've been more keen to implement logging using the same approach as Varnish rather than files. |
You are right: GET 100.html 5M request 1K connexions:
conclusion: log file it's not the best way.
Like this ?: https://github.com/varnishcache/varnish-cache/blob/a50c99f6b3883d1a58cedfe26511bfc0d30d50bb/bin/varnishtest/vtc_log.c |
Thank's I fond this sample: https://github.com/rohitsinha54/shared-memory-producer-consumer/blob/master/prodcon.c. What do you think of this @lpereira ?: |
That's the idea, @0x003e. In fact, if we could get the SHM format and protocol the same as Varnish's, then all the tools developed for Varnish can be used as well with little to no modification. |
I made a change where it logs 4xx and 5xx as warnings, and leaves everything else fast and unlogged. I like it because I can now see if there's problems with my site, like if I'm missing files, or if one of my custom handlers are failing, or a hacker is trying to probe my server. I haven't benchmarked this change at all yet, but it should still run just as fast for 2xx and 3xx. This project is amazing, I really like being able to extend it like this because the code is that simple. |
Good to know it's working well for you, @samiam308! |
Hi @lpereira ,
Do you think create a "log file" functonality (release and debug) is a good idea ? to write on a file (specified in .conf) all messages of this flowing functions:
I can implement it with a pull request.
The text was updated successfully, but these errors were encountered: