[squid-users] Compiling Squid without log messages
Amos Jeffries
squid3 at treenet.co.nz
Thu Jan 15 10:59:10 UTC 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 15/01/2015 11:00 p.m., Alan wrote:
> 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?
Well ... take a guess where to look :-P
If you are disabling anything via manual alteration of the code
instead of the ./configure --disable options (you mention using sed)
then one of the things you *do* need is the debugs() logging.
cache.log / debugs() is not just for debugging either. It is also for
recording major/critical events that you as administrator really,
really need to be made aware of.
Though, on the diagnosis I suggest at least trying with a macro name
other than "NODEBUG". For some reason that macro is used to disable
the assertion handling.
Amos
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)
iQEcBAEBAgAGBQJUt519AAoJELJo5wb/XPRjjDcH/jw+0nRZEfpu4ydg7M0q73PY
IVZFWXO6jc1WPKBoix7QoOiRDE95/umt5vKtMo9EkENhTLyPIwcggfql8aDhQYv2
uqR0To+wXECK9N6FfYentOFAONayeI2ecKy1Ttp+SMkjbg5xTzVwDZcyyQkxpiFE
uTa8um39PS7hSr255+WNA6wcsmDpa8B3BOioSp8TDUnOu/ImnH7A8XI2MfsjicTH
S8ijQ6eFP6YcAOrzPF8eJbWP3gqZVSyA7C815ZdiySRgwF34ym24RhoGx0yi+nqE
QrIunGZH6gMZsypeqW6I3TwWfYmYEqYTvASZyUA2MA7bU0GTuJtkJWR7cTnJ8Mg=
=4Xlr
-----END PGP SIGNATURE-----
More information about the squid-users
mailing list