[squid-users] Compiling Squid without log messages

Alan lameventanas at gmail.com
Thu Jan 15 10:00:18 UTC 2015


Hello,

I want to have a minimal Squid installation.
So I compiled disabling everything I don't need.
The resulting /usr/sbin/squid is 3.4 Mb.

Since I don't need logging, I decided to remove that as well, but its
not easy to do with sed since sometimes log messages span multiple
lines.

So I changed the definition for debugs() in Debug.h like this:


 /* Debug stream */
+#ifdef NODEBUG
+#define debugs(SECTION, LEVEL, CONTENT) ((void)0)
+#else
 #define debugs(SECTION, LEVEL, CONTENT) \
    do { \
         if ((Debug::level = (LEVEL)) <= Debug::Levels[SECTION]) { \
@@ -116,6 +119,7 @@
             Debug::finishDebug(); \
         } \
    } while (/*CONSTCOND*/ 0)
+#endif


And compiled with -DNODEBUG.
The resulting binary is 2.1 Mb, a 60% size reduction!

But it doesn't work properly, and since there is no log, its hard to debug.

A trace shows it accepts requests, makes them to the HTTP server, but
after that it closes the connection to the HTTP client.

Any ideas?


More information about the squid-users mailing list