Ask your Symfony questions! Pay money and get answers fast! (more info)

How to get more info from Symfony to my Apache logs? Symfony

A bit of my Apache logs:

[Mon Nov 29 14:15:06 2010] [warn] mod_fcgid: stderr: This request has been forwarded to a 404 error page by the action "user/discourse".
[Mon Nov 29 14:16:54 2010] [warn] mod_fcgid: stderr: This request has been forwarded to a 404 error page by the action "user/discourse".
[Mon Nov 29 14:17:15 2010] [warn] mod_fcgid: stderr: This request has been forwarded to a 404 error page by the action "user/showUsersAnswers".
[Mon Nov 29 16:46:44 2010] [warn] mod_fcgid: stderr: The template "show.php" does not exist or is unreadable in "".
[Mon Nov 29 18:55:43 2010] [warn] mod_fcgid: stderr: Empty module and/or action after parsing the URL "/sitemap.xml" (/).
[Mon Nov 29 22:32:55 2010] [warn] mod_fcgid: stderr: The template "show.php" does not exist or is unreadable in "".
[Mon Nov 29 22:35:08 2010] [warn] mod_fcgid: stderr: This request has been forwarded to a 404 error page by the action "question/show".
[Mon Nov 29 22:35:09 2010] [warn] mod_fcgid: stderr: Action "show/id" does not exist.
[Mon Nov 29 22:35:09 2010] [warn] mod_fcgid: stderr: This request has been forwarded to a 404 error page by the action "question/show".
[Mon Nov 29 22:35:09 2010] [warn] mod_fcgid: stderr: Action "show/id" does not exist.
[Mon Nov 29 22:41:09 2010] [warn] mod_fcgid: stderr: This request has been forwarded to a 404 error page by the action "user/profile".
[Mon Nov 29 22:42:58 2010] [warn] mod_fcgid: stderr: This request has been forwarded to a 404 error page by the action "user/showUsersAnswers".
[Tue Nov 30 00:01:48 2010] [warn] mod_fcgid: stderr: The template "show.php" does not exist or is unreadable in "".





I'm especially curious about:

Action "show/id" does not exist.

Anyway to force Symfony to send more info to Apache, or to automatically record info itself? Mostly I want the referer that triggered this error.

Answers (2)

2010-11-30

Joshua Estes answers:

Symfony already records info in it's own logs. Check the ./log directory. There is documentation on how to set this stuff up.

2010-11-30

José Nahuel Cuesta Luengo answers:

You can configure symfony to use an sfFileLogger (the default behavior) in the <strong>factories.yml</strong> file for your app(s), and set it to dump the logging on a shared file, such as an apache log or something like that:


logger:
my_file_logger:
class: sfFileLogger
param:
level: debug
file: /route/to/your/desired/file.log


Bare in mind that apache user must have write access to /route/to/your/desired/file.log


José Nahuel Cuesta Luengo comments:

Aside from the sfFileLogger, you can force from your actions the logging of specific actions. That way you'll get all the info you want, even though symfony doesn't consider it worth-logging..