Welcome Guest, Not a member yet? Register   Sign In
Where is log file?
#1

[eluser]Arun Joshi[/eluser]
Hi am new in CI. I used log_message('level', 'message') to write log information. But I couldn't find the log file. Can anyone suggest where is its location...
Thanks
Arun.
#2

[eluser]davidbehler[/eluser]
logfile should be in "system/logs"
#3

[eluser]Jagar[/eluser]
It depends what server you are using, the system/logs folder may need write access. The default location for logs is that place if you haven't changed it.
#4

[eluser]Arun Joshi[/eluser]
but I can only find an index.html inside system/logs folder. Do I need to set a log file name anywhere in a configuration file.
#5

[eluser]Jagar[/eluser]
In your system/application/config/config.php

On this line:
Code:
$config['log_threshold'] = 1;
is that set to any number between 1 to 4?

Also
Code:
$config['log_path'] = '';
is there something in there, if not then the default will be systems/logs

What server are you using by the way?
#6

[eluser]Zeeshan Rasool[/eluser]
Hi, You can do it by making little change in log.php
Here you can see..

create your log file

Also yo can use like this in model.
Code:
if (!$query)
{
$website     = "http://".$_SERVER['HTTP_HOST'];
$errNo       = $this->db->_error_number();
$errMess     = $this->db->_error_message();//chang log.php
log_message("error", "Problem Inserting to".$website." \n".$errMess." (".$errNo.")");
}
#7

[eluser]Arun Joshi[/eluser]
Thanks Jagar.
My $config['log_threshold'] value is 0. I changed its values from 0-4 and got log file entries.

My log file content is

DEBUG - 2009-04-29 06:45:30 --> Config Class Initialized
DEBUG - 2009-04-29 06:45:30 --> Hooks Class Initialized
DEBUG - 2009-04-29 06:45:30 --> URI Class Initialized
DEBUG - 2009-04-29 06:45:30 --> Router Class Initialized
DEBUG - 2009-04-29 06:45:30 --> Output Class Initialized
DEBUG - 2009-04-29 06:45:30 --> Input Class Initialized
DEBUG - 2009-04-29 06:45:30 --> Global POST and COOKIE data sanitized
DEBUG - 2009-04-29 06:45:30 --> Language Class Initialized
DEBUG - 2009-04-29 06:45:30 --> Loader Class Initialized
DEBUG - 2009-04-29 06:45:30 --> Controller Class Initialized
INFO - 2009-04-29 06:45:30 --> this content will help me to identify the error log location.
DEBUG - 2009-04-29 06:45:30 --> its a debug message
ERROR - 2009-04-29 06:45:30 --> its error message.

DEBUG - 2009-04-29 06:45:30 --> Final output sent to browser
DEBUG - 2009-04-29 06:45:30 --> Total execution time: 0.0425

The above three blue lines are my error message. I need only that three lines. So how can I ignore the remaining lines.
#8

[eluser]Jagar[/eluser]
Glad I could help Smile

Number 4 will display all the errors.

So choose one that best suit you.

1 = Error Messages (including PHP errors)
2 = Debug Messages
3 = Informational Messages
4 = All Messages

Try 2 or 1
#9

[eluser]Arun Joshi[/eluser]
My log file content.

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

DEBUG - 2009-04-29 07:07:03 --> Config Class Initialized
DEBUG - 2009-04-29 07:07:03 --> Hooks Class Initialized
DEBUG - 2009-04-29 07:07:03 --> URI Class Initialized
DEBUG - 2009-04-29 07:07:03 --> Router Class Initialized
DEBUG - 2009-04-29 07:07:03 --> Output Class Initialized
DEBUG - 2009-04-29 07:07:03 --> Input Class Initialized
DEBUG - 2009-04-29 07:07:03 --> Global POST and COOKIE data sanitized
DEBUG - 2009-04-29 07:07:03 --> Language Class Initialized
DEBUG - 2009-04-29 07:07:03 --> Loader Class Initialized
DEBUG - 2009-04-29 07:07:03 --> Controller Class Initialized
DEBUG - 2009-04-29 07:07:03 --> its my test debug message
DEBUG - 2009-04-29 07:07:03 --> Final output sent to browser
DEBUG - 2009-04-29 07:07:03 --> Total execution time: 0.0394


How can I log my own error message only(blue line)?
#10

[eluser]Jagar[/eluser]
Sorry but I'm not sure how that can be done, I always use number 4.

Hopefully somebody will know the answer to that.




Theme © iAndrew 2016 - Forum software by © MyBB