ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to create log file using codeigniter

April 28, 2010 12:16am

Subscribe [3]
  • #1 / Apr 28, 2010 12:16am

    senz

    12 posts

    Hi all,
    I wanna ask something about codeigniter.
    How do I create log files using CodeIgniter? And what is the difference between the log file with an existing session in the config file? I want to create a log file from web site visitors such as IP addresses, time and whatever page is clicked. I have been searching in google but did not get a clue. Please someone who can help me?

  • #2 / Apr 28, 2010 10:32am

    danmontgomery

    1802 posts

    These logs are kept by your webserver. For detailed analytics you can use a hosted solution like google analytics, or a log analyzer like awstats or webalizer

  • #3 / Apr 28, 2010 10:36pm

    senz

    12 posts

    Then how to create log files that can be directly inserted into the database? I mean the code making with codeigniter?.. There is any code that i can use from codeigniter to make log file?

  • #4 / Apr 28, 2010 10:41pm

    Tom Schlick

    386 posts

    just do an database insert with the timestamp, ip address, and current uri. put it in a model’s constructor and autoload that model on every page

  • #5 / Apr 29, 2010 12:52am

    senz

    12 posts

    @Tom : I’m newbie with codeigniter tom and i don’t know what the code i must write. Can you give me the link where i can get and read the code about created the log files and inserted into the database?
    Thanks before tom..

  • #6 / Apr 30, 2010 4:41am

    eoinmcg

    311 posts

    @senz, here’s an article describing sth very similar:
    http://www.gostomski.co.uk/codeigniter/simple-stats-collection-with-codeigniter-hooks

    a word of caution though, logging every hit will eventually make for a very large database.

  • #7 / Apr 30, 2010 7:02am

    senz

    12 posts

    @eoinmcg : Wow..i just visited that link and that what i want!! Thanks 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases