CodeIgniter Forums
Viewing log files in CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Viewing log files in CI (/thread-49937.html)



Viewing log files in CI - El Forum - 03-08-2012

[eluser]machouinard[/eluser]
I'm using CI on a few different sites.

On one site I can view the log files at http://mysite.com/application/logs/log.php

log.php is apparently a log file viewer written by Chris Petermann. For the life of me I can't remember putting it in my logs directory. I searched CI, but came up with nothing.

Anyway, I can't figure out what is allowing me access to that file on that site.
I'd assume it would be obvious in .htaccess
Code:
allow from all
Options -Indexes
Options +FollowSymLinks
Options -MultiViews
DirectoryIndex index.php
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [NC,L,QSA]
</IfModule>

<IfModule !mod_rewrite.c>
  ErrorDocument 404 index.php
</IfModule>
But it's not.

Anyone have any ideas? Or any good suggestions about viewing log files?

Thanks,
Mark


Viewing log files in CI - El Forum - 03-08-2012

[eluser]InsiteFX[/eluser]
AJAX Logfile Tailer & Viewer



Viewing log files in CI - El Forum - 03-08-2012

[eluser]machouinard[/eluser]
That logfile viewer looks great, but I still can't figure out how to allow access to the log files at application/logs/.

If I understand correctly, my .htaccess file basically says if the URL being requested isn't a file or directory then let CI handle it through index.php.

I don't understand why I can access the log files on one site but get a 404 on another. The .htaccess and file structure are identical on both sites I'm working with.

I tried switching the rewrite conditions to
Code:
RewriteCond $1 !^(index\.php|public|application|images|css|js|robots\.txt|favicon\.ico)
but I still get a 404 error when trying to access http://mysite.com/application/logs/log.php

What am I missing? Something simple?





Viewing log files in CI - El Forum - 03-08-2012

[eluser]InsiteFX[/eluser]
Code:
RewriteCond $1 !^(index\.php|public|application|logs|images|css|js|robots\.txt|favicon\.ico)

Make sure that you have read/write access to the directory!

You need to turn that code int a controller...