Gordon Colburn | 13 Apr 2010 15:43

Re: Logging

I don’t know of any good way to configure one log file per process. Instead, consider using a single log file (like you are now) and define your logging format so that it contains a process identifier of some kind (e.g. PID). If you are running on a Unix-like OS, you can then use the various command-line tools (e.g. awk, grep) to filter out the messages for a particular process if needed. With this approach, by default you have an aggregate view of the logs but it is also easy to view the logs by process (I find myself needing to do both on occasion). Plus, it is less cumbersome (IMO) to have a single log file than 50.

 

BTW, if you are deploying to a Windows machine, you can still use awk, grep, etc. to filter the logs; just install Cygwin (www.cygwin.com).

 

Regards,

Gordon

 

From: fastcgi-developers-bounces+gordon=group309.com-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org [mailto:fastcgi-developers-bounces+gordon=group309.com-xGejAJT2w6xVgU18Zptdiw@public.gmane.orgcom] On Behalf Of Paulo Jorge Dias
Sent: Tuesday, April 13, 2010 4:26 AM
To: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
Subject: [FASTCGI] Logging

 

Hi all,

I have a fastcgi based service with Apache 2.2 with the configuration bellow.

I am facing logging problems because all 50 processes write to the same file (error_log) and the messages are mixed.

Is there any configuration in order to have one log file per each fast-cgi process?

Httpd.conf

ErrorLog "logs/error_log"
LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule mod_fastcgi.c>
    Alias /fcgi-bin/ /app/onlinec/applon/exe/
    <Directory /app/onlinec/applon/exe>
      AllowOverride None
      Allow from all
    </Directory>
    #
    # Start a "static" server at httpd initialization inside the scope of the SetHandler
    #
    FastCgiServer /app/onlinec/applon/exe/elag -processes 50 -idle-timeout 180 -restart-delay 5 -initial-env LD_PRELOAD=/usr/lib/0 <at> 0.so.1 -initial-env NLS
_LANG=AMERICAN_AMERICA.WE8ISO8859P1 -initial-env LD_LIBRARY_PATH=/usr/openwin/lib:/app/fcgi/lib:/app/oracle/instclient -initial-env DBCONNECT=XXXXX/XXXXX <at> XXXXX:####/XXXXX -initial-env ENVFILE=/app/onlinec/resources/config/applon.env
    #
    LogFormat "%P %t %>s %T %a %B \"%r\"" common
    CustomLog logs/access_log common
</IfModule>

Best regards,

--
Paulo Jorge Dias

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
Paulo Jorge Dias | 13 Apr 2010 19:30
Picon

Re: Logging

Unfortunately I have already thought of use that approach but the application I am talking about is a migration from other technology and all the logging is hardcoded and spread over many files.

I notice also situations where the mix of logging is not only at line level, but also at string level, like two or more SQL statements mixed.

Best regards,

2010/4/13 Gordon Colburn <gordon-ph3hwQsbQ5bQFizaE/u3fw@public.gmane.orgm>

I don’t know of any good way to configure one log file per process. Instead, consider using a single log file (like you are now) and define your logging format so that it contains a process identifier of some kind (e.g. PID). If you are running on a Unix-like OS, you can then use the various command-line tools (e.g. awk, grep) to filter out the messages for a particular process if needed. With this approach, by default you have an aggregate view of the logs but it is also easy to view the logs by process (I find myself needing to do both on occasion). Plus, it is less cumbersome (IMO) to have a single log file than 50.

 

BTW, if you are deploying to a Windows machine, you can still use awk, grep, etc. to filter the logs; just install Cygwin (www.cygwin.com).

 

Regards,

Gordon

 

From: fastcgi-developers-bounces+gordon=group309.com <at> mailman.fastcgi.com [mailto:fastcgi-developers-bounces+gordon=group309.com <at> mailman.fastcgi.com] On Behalf Of Paulo Jorge Dias
Sent: Tuesday, April 13, 2010 4:26 AM
To: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
Subject: [FASTCGI] Logging

 

Hi all,



I have a fastcgi based service with Apache 2.2 with the configuration bellow.

I am facing logging problems because all 50 processes write to the same file (error_log) and the messages are mixed.

Is there any configuration in order to have one log file per each fast-cgi process?

Httpd.conf

ErrorLog "logs/error_log"
LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule mod_fastcgi.c>
    Alias /fcgi-bin/ /app/onlinec/applon/exe/
    <Directory /app/onlinec/applon/exe>
      AllowOverride None
      Allow from all
    </Directory>
    #
    # Start a "static" server at httpd initialization inside the scope of the SetHandler
    #
    FastCgiServer /app/onlinec/applon/exe/elag -processes 50 -idle-timeout 180 -restart-delay 5 -initial-env LD_PRELOAD=/usr/lib/0 <at> 0.so.1 -initial-env NLS
_LANG=AMERICAN_AMERICA.WE8ISO8859P1 -initial-env LD_LIBRARY_PATH=/usr/openwin/lib:/app/fcgi/lib:/app/oracle/instclient -initial-env DBCONNECT=XXXXX/XXXXX <at> XXXXX:####/XXXXX -initial-env ENVFILE=/app/onlinec/resources/config/applon.env
    #
    LogFormat "%P %t %>s %T %a %B \"%r\"" common
    CustomLog logs/access_log common
</IfModule>

Best regards,

--
Paulo Jorge Dias




--
Paulo Jorge Dias
_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
Tom Bowden | 14 Apr 2010 23:03
Picon

Re: Logging

I typically use syslog() for that sort of thing -- it is extremely flexible and lets me do things like specify rules to transfer logs to other systems/syslog daemons.

On Apr 13, 2010, at 12:30 PM, Paulo Jorge Dias wrote:

Unfortunately I have already thought of use that approach but the application I am talking about is a migration from other technology and all the logging is hardcoded and spread over many files.

I notice also situations where the mix of logging is not only at line level, but also at string level, like two or more SQL statements mixed.

Best regards,

2010/4/13 Gordon Colburn <gordon-ph3hwQsbQ5ZWk0Htik3J/w@public.gmane.org>

I don’t know of any good way to configure one log file per process. Instead, consider using a single log file (like you are now) and define your logging format so that it contains a process identifier of some kind (e.g. PID). If you are running on a Unix-like OS, you can then use the various command-line tools (e.g. awk, grep) to filter out the messages for a particular process if needed. With this approach, by default you have an aggregate view of the logs but it is also easy to view the logs by process (I find myself needing to do both on occasion). Plus, it is less cumbersome (IMO) to have a single log file than 50.

 

BTW, if you are deploying to a Windows machine, you can still use awk, grep, etc. to filter the logs; just install Cygwin (www.cygwin.com).

 

Regards,

Gordon

 

From: fastcgi-developers-bounces+gordon=group309.com <at> mailman.fastcgi.com [mailto:fastcgi-developers-bounces+gordon=group309.com <at> mailman.fastcgi.com] On Behalf Of Paulo Jorge Dias
Sent: Tuesday, April 13, 2010 4:26 AM
To: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
Subject: [FASTCGI] Logging

 

Hi all,



I have a fastcgi based service with Apache 2.2 with the configuration bellow.

I am facing logging problems because all 50 processes write to the same file (error_log) and the messages are mixed.

Is there any configuration in order to have one log file per each fast-cgi process?

Httpd.conf

ErrorLog "logs/error_log"
LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule mod_fastcgi.c>
    Alias /fcgi-bin/ /app/onlinec/applon/exe/
    <Directory /app/onlinec/applon/exe>
      AllowOverride None
      Allow from all
    </Directory>
    #
    # Start a "static" server at httpd initialization inside the scope of the SetHandler
    #
    FastCgiServer /app/onlinec/applon/exe/elag -processes 50 -idle-timeout 180 -restart-delay 5 -initial-env LD_PRELOAD=/usr/lib/0 <at> 0.so.1 -initial-env NLS
_LANG=AMERICAN_AMERICA.WE8ISO8859P1 -initial-env LD_LIBRARY_PATH=/usr/openwin/lib:/app/fcgi/lib:/app/oracle/instclient -initial-env DBCONNECT=XXXXX/XXXXX <at> XXXXX:####/XXXXX -initial-env ENVFILE=/app/onlinec/resources/config/applon.env
    #
    LogFormat "%P %t %>s %T %a %B \"%r\"" common
    CustomLog logs/access_log common
</IfModule>

Best regards,

--
Paulo Jorge Dias




--
Paulo Jorge Dias
_______________________________________________
FastCGI-developers mailing list

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers@...
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers

Gmane