Error Log File In Codeigniter
Contents |
Chart Model-View-Controller Architectural Goals Tutorial Static pages News section Create news items Conclusion Contributing to CodeIgniter Writing CodeIgniter Documentation Developer's codeigniter error log file location Certificate of Origin 1.1 General Topics CodeIgniter URLs Controllers
Codeigniter Write To Log File
Reserved Names Views Models Helpers Using CodeIgniter Libraries Creating Libraries Using CodeIgniter Drivers Creating create log file in codeigniter Drivers Creating Core System Classes Creating Ancillary Classes Hooks - Extending the Framework Core Auto-loading Resources Common Functions Compatibility Functions URI Routing Error codeigniter custom log file Handling Caching Profiling Your Application Running via the CLI Managing your Applications Handling Multiple Environments Alternate PHP Syntax for View Files Security PHP Style Guide Libraries Benchmarking Class Caching Driver Calendaring Class Shopping Cart Class Config Class Email Class Encrypt Class Encryption Library File Uploading Class
Log_threshold Codeigniter
Form Validation FTP Class Image Manipulation Class Input Class Javascript Class Language Class Loader Class Migrations Class Output Class Pagination Class Template Parser Class Security Class Session Library HTML Table Class Trackback Class Typography Class Unit Testing Class URI Class User Agent Class XML-RPC and XML-RPC Server Classes Zip Encoding Class Database Reference Quick Start: Usage Examples Database Configuration Connecting to a Database Running Queries Generating Query Results Query Helper Functions Query Builder Class Transactions Getting MetaData Custom Function Calls Query Caching Database Manipulation with Database Forge Database Utilities Class Database Driver Reference Helpers Array Helper CAPTCHA Helper Cookie Helper Date Helper Directory Helper Download Helper Email Helper File Helper Form Helper HTML Helper Inflector Helper Language Helper Number Helper Path Helper Security Helper Smiley Helper String Helper Text Helper Typography Helper URL Helper XML Helper
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack codeigniter log user activity Overflow the company Business Learn more about hiring developers or posting ads with us codeigniter write to file Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a
Codeigniter Debug Log
community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Codeigniter not creating any log files up vote 10 down vote favorite 4 Under config.php https://www.codeigniter.com/user_guide/general/errors.html I have: $config['log_threshold'] = 4; $config['log_path'] = '/home/myaccount/logFilesFolder'; In index.php I have: error_reporting(E_ALL); The only way I can seem to get anything to log is if I chmod that directory to rwx (777), which doesn't seem right to me. That and it doesn't see to be logging all the errors. In my local/dev environment it seems to be working but on my production server nothing is being logged. I can't seem http://stackoverflow.com/questions/6414607/codeigniter-not-creating-any-log-files to figure out why. codeigniter logging share|improve this question edited Jun 20 '11 at 16:54 oliholz 5,68322863 asked Jun 20 '11 at 16:43 Stephane Grenier 6,8852469137 did your problem solved? –afarazit Jun 20 '11 at 18:18 add a comment| 4 Answers 4 active oldest votes up vote 9 down vote accepted The log filename in the configuration settings needs a trailing "/" above making sure the webserver process has writeable access to the directory. share|improve this answer answered Jul 3 '11 at 2:26 Stephane Grenier 6,8852469137 add a comment| up vote 4 down vote Change the logs owner and group to what owner/group your live web server is running, give it write perms and it should work. I take it that in your local/dev server your CI folder is owned by you that is why you need to chmod it to 777 to make it work. share|improve this answer answered Jun 20 '11 at 16:47 afarazit 3,77712045 add a comment| up vote 3 down vote The directory where you want the log files to be saved needs to be writable. share|improve this answer edited Aug 27 '12 at 19:22 Leniel Macaferi 61.9k24245328 answered Jun 20 '11 at 16:50 Alex 22916 thank you!!!! dont know how many
described below. In addition, it has an error logging class that permits error and debugging messages to be saved as text files. Note: By default, CodeIgniter displays all PHP errors. You might wish to change this https://www.codeigniter.com/userguide2/general/errors.html behavior once your development is complete. You'll find the error_reporting() function located at the top of your main index.php file. Disabling error reporting will NOT prevent log files from being written if there are errors. Unlike most systems in CodeIgniter, the error functions are simple procedural interfaces that are available globally throughout the application. This approach permits error messages to get triggered without having to worry about class/function scoping. The following log file functions let you generate errors: show_error('message' [, int $status_code= 500 ] ) This function will display the error message supplied to it using the following error template: application/errors/error_general.php The optional parameter $status_code determines what HTTP status code should be sent with the error. show_404('page' [, 'log_error']) This function will display the 404 error message supplied to it using the following error template: application/errors/error_404.php The function expects the string passed to it to error log file be the file path to the page that isn't found. Note that CodeIgniter automatically shows 404 messages if controllers are not found. CodeIgniter automatically logs any show_404() calls. Setting the optional second parameter to FALSE will skip logging. log_message('level', 'message') This function lets you write messages to your log files. You must supply one of three "levels" in the first parameter, indicating what type of message it is (debug, error, info), with the message itself in the second parameter. Example: if ($some_var == "")
{
log_message('error', 'Some variable did not contain a value.');
}
else
{
log_message('debug', 'Some variable was correctly set');
}
log_message('info', 'The purpose of some variable is to provide some value.');
There are three message types: Error Messages. These are actual errors, such as PHP errors or user errors. Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info. Informational Messages. These are the lowest priority messages, simply giving information regarding some process. CodeIgniter doesn't natively generate any info messages but you may want to in your application. Note: In order for the log file to actually be written, the "logs" folder must be