logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_fcgid: How to disable logging?
Author
Snecx



Joined: 14 Dec 2006
Posts: 6

PostPosted: Thu 14 Dec '06 1:37    Post subject: mod_fcgid: How to disable logging? Reply with quote

Hello all!

I've been browsing this forum quite a lot lately. My server was crashing every now and then due to memory problems but with the help from many discussions, I managed to improve the performance of my win2003 server using mod_fcgid. I managed to save 400mb of RAM usage and it is all stable right now. Wink

Just one small little question, how do I disable the notices from mod_fcgid in the Apache error log? Is it even possible?

The error.log file grows about 3mb a day just because of these notices and I don't like these unnecessary logging. Smile

Edit: Nevermind, I think I found a line in the Apache manual which explains it:

Quote:

Note

When logging to a regular file messages of the level notice cannot be suppressed and thus are always logged. However, this doesn't apply when logging is done using syslog.
Back to top
Snecx



Joined: 14 Dec 2006
Posts: 6

PostPosted: Tue 09 Jan '07 20:55    Post subject: Reply with quote

Well haven't found a fix. My error.log file grew to 3gb after a month. I am looking for a way to suppress these notices so I don't need to restart my Apache server every month just to clean the error.log file.

Anybody has any solution? Logging with syslog is not available for Windows server.

Edit:
Never mind. I always get a fix after I post questions. I can just delete the log without any problems. For some reason the last time I tried I was not able to delete the error log. Or perhaps it is the access log, maybe I got it mistaken.

Edit 2:
Looks like I am able to delete the log from my XP developer machine while Apache is running, then Apache simply recreates a new log.

However, on my production server, the log got deleted BUT when there are new entries into the log, the log is recreated with the same file-size as previous error log.

Furthermore, after the first delete, the error log can no longer be deleted again.

I am not sure if this is a glitch or what but I am a bit hesitant on restarting my webserver just to get rid of excessive logging data.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Tue 09 Jan '07 21:24    Post subject: Reply with quote

Maybe you can contact the author Ryan Pan of mod_fcgid at pqf op mailtech.cn , he is very helpfull,
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Tue 09 Jan '07 21:27    Post subject: Reply with quote

Have also a look at the clear logs script at http://www.blackdot.be/?inc=apache/knowledge
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Wed 10 Jan '07 6:11    Post subject: Reply with quote

mod_fcgid has a bug tracking system.

It might be a good idea to enter a new bug requesting that mod_fcgid log messages as 'Warn' or 'Info' as appropriate.
These messages can be suppressed using the LogLevel directive.

Traditionally, only one-time startup log messages use 'Notice'.

If you are comfortable building a module from source, you could download the source code and fix it yourself.

Search all the .c files and change every occurrence of APLOG_NOTICE to either APLOG_INFO or APLOG_WARNING, depending on whether you wish to see it in your log.

For example, in fcgid_proc_win.c you could change
Code:
      ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, procinfo->main_server,
                "mod_fcgid: call %s with wrapper %s",
                procinfo->cgipath, wrapperpath);
to
Code:
      ap_log_error(APLOG_MARK, APLOG_INFO, 0, procinfo->main_server,
                "mod_fcgid: call %s with wrapper %s",
                procinfo->cgipath, wrapperpath);


Note that the warning level is just "Warn" in httpd.conf, but the name to use in the source code is APLOG_WARNING.
"Info" and "Notice" are what you would expect - APLOG_INFO and APLOG_NOTICE.

-tom-
Back to top
Snecx



Joined: 14 Dec 2006
Posts: 6

PostPosted: Wed 10 Jan '07 13:10    Post subject: Reply with quote

Thanks Steffen and tdonovan.

I have submitted the bug report and see if someone is up for it. Else I will have to learn to modify and compile the sources myself. I have no experience with these however.


@Steffen:
I see that you also uses mod_fcgid on this site. Would you mind if I ask how big does your error log gets and how do you handle it once it grow too large for your preference?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Wed 10 Jan '07 19:39    Post subject: Reply with quote

I only get this two lines now and then in the log:

[Tue Jan 09 20:51:16 2007] [notice] mod_fcgid: call F:/web/al/forum/rss.php with wrapper d:/servers/apache/php/php-cgi.exe
[Tue Jan 09 20:51:16 2007] [notice] mod_fcgid: server F:/web/al/forum/rss.php(3208) started

My logs are auto emptied every day by my stats , which runs as a CRON once a day.

Steffen
Back to top
Snecx



Joined: 14 Dec 2006
Posts: 6

PostPosted: Wed 10 Jan '07 23:45    Post subject: Reply with quote

Those are the only lines that I get, except for Apache start-up/shutdown notices. I have quite a busy site and those 2 mod_fcgid lines are taking up GB's of space.

I added log rotation for the error log so I don't get one big locked file. Thanks for the help, I guess I'll have to live with this work-around.

Smile
Back to top


Reply to topic   Topic: mod_fcgid: How to disable logging? View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules