Welcome Guest, Not a member yet? Register   Sign In
How do 'enviornments' affect error logging?
#1

[eluser]@li[/eluser]
In the comments in the new index.php its written that the 'environments' effect both whether errors are displayed or not, and also whether errors are logged or not.

Inside the same index.php file I can change how the error displaying can be changed (for example if i want to add more environments I could specify their error reporting here), but where can I see the error logging settings for an environment?
#2

[eluser]@li[/eluser]
anyone??
#3

[eluser]@li[/eluser]
bump, would appreciate a reply
#4

[eluser]InsiteFX[/eluser]
Look in the application/config/config.php file

InsiteFX
#5

[eluser]@li[/eluser]
[quote author="InsiteFX" date="1301432033"]Look in the application/config/config.php file

InsiteFX[/quote]
Insite,I only see the logging threshhold there but no mention of the environments. This is what the index.php file says:


Quote:* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging
and error reporting.

This is my question, how does the environment influence logging?
#6

[eluser]InsiteFX[/eluser]
The threshhold sets the amount of errors being returned!

If you want to know more about the CI logging look at the CI Log Class

Read the CodeIgniter User Guide! It is your friend.

InsiteFX
#7

[eluser]@li[/eluser]
Insight thanks, I know about that, I'm asking if 'environment' has any effect on logging, like the comments say in index.php:

Quote:Setting the environment also influences things like logging

I'm trying to find out what that means
#8

[eluser]InsiteFX[/eluser]
And what does the index.php file tell you?

Read the Comments!
Code:
define('ENVIRONMENT', 'development');
/*
*---------------------------------------------------------------
* ERROR REPORTING
*---------------------------------------------------------------
*
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.
*/

    switch (ENVIRONMENT)
    {
        case 'development':
            error_reporting(E_ALL); // Report all Errors!
        break;

        case 'testing':
        case 'production':
            error_reporting(0);     // Report no Errors!
        break;

        default:
            exit('The application environment is not set correctly.');
    }

InsiteFX
#9

[eluser]@li[/eluser]
....................................

I'm not talking about error reporting, my question is about logging. The comments say:
Quote:Setting the environment also influences things like logging

Full quote:

Code:
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting.
*
* This can be set to anything, but default usage is:
*
*     development
*     testing
*     production
*
* NOTE: If you change these, also change the error_reporting() code below
*
*/
    define('ENVIRONMENT', 'development');
/*

I'm just trying to find out how. If this comment is wrong and the environment in fact doesn't influence logging, then I'd just like to know so I can move on.
#10

[eluser]troy_mccormick[/eluser]
By simply viewing the source for the Log.php library, you can see that the ENVIRONMENT constant isn't checked anywhere...so the comment is incorrect, though I think that is something that should be added, and seems that it would be trivial to accomplish. If only I could use git through my work proxy...maybe when I get time at home Tongue

https://bitbucket.org/ellislab/codeignit...es/Log.php




Theme © iAndrew 2016 - Forum software by © MyBB