Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8489415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:49:20+00:00 2026-06-10T21:49:20+00:00

I need to log Fatal-errors of my website. I normally check error.log and debug.log

  • 0

I need to log Fatal-errors of my website.

I normally check error.log and debug.log files for CakePHP errors.
But I found out that PHP related fatal errors aren’t logged someplace.
It is also discussed in this thread.

I checked php.ini. IT has following lines:

log_errors = On
;error_log = filename

I don’t have rights to change php.ini. I can ask admin to change this, but it seems like I need to ask him every time I need a change 🙂 I also have concerns about performance. Whether logging errors can decrease performance or not?

So I find out that I can put following two lines inside my script to log errors and change folder or file name when I need.

ini_set("log_errors", 1);
ini_set("error_log", "/path/to/php-error.log");

So I want to know where to put this lines inside my codes? Should I put it inside AppController::beforeFilter ? Or is there a better place/solution in CakePHP 2 configuration?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:49:21+00:00Added an answer on June 10, 2026 at 9:49 pm

    this is an old thread.
    in the meantime with cake 2.x errors are all logged in productive mode – so also fatal errors.

    trigger one and check out your /tmp/logs/error.log

    but you can easily find that out looking at the core code:
    https://github.com/cakephp/cakephp/blob/master/lib/Cake/Error/ErrorHandler.php#L189

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to log a user out and redirect to a URL. How would
I am trying to setup PHP to log errors locally so that I can
Something in my PHP script is causing a fatal error, but I ca't seem
I need a solution to catch all PHP fatal errors, exceptions, warnings, etc. and
I need to log some events on a Clojure Client-Server scenario, but it seems
Situation is that level of log4net is configured as 'Error' but there is some
I need to log sessions to database on my asp.net website: who and when
i need to log each method call in my application. i dont want to
I need to log in a user with credentials from the database. However, an
I need to log all post and get requests on web site in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.