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.

Logging to files

May 09, 2011 5:13am

Subscribe [2]
  • #1 / May 09, 2011 5:13am

    Fritzinger

    35 posts

    How do I write my own log messages to log files? I’m a bit lost between what is the EE way of doing things vs the CodeIgniter way of doing things. I can’t actually find any mention anywhere of how to do this with EE, and a cursory grep reveals nothing on the filesystem that looks like a directory for logfiles. system/logs is mentioned in config.php as a default but there’s no such directory.

    I know that I can log to control panel logs, and I know that I can get debugging info on my pages if I set the right preferences. Neither is adequate, how do I get this stuff into files?

  • #2 / May 09, 2011 6:54am

    Fritzinger

    35 posts

    Ok, I’ve managed to make this work by:

    Changing $config[‘log_threshold’] to 4
    Putting an absolute URL into $config[‘log_path’] pointing to system/logs/
    Creating the system/logs/ directory

    It seems a bit weird that I had to create system/logs myself. If leaving ‘log_path’ blank points to system/logs by default, why didn’t the directory exist already? Or is the actual default log directory meant to be someplace else?

  • #3 / May 09, 2011 3:04pm

    Brandon Jones

    5500 posts

    Hi Fritzinger,

    We don’t ship with a system/logs folder since logging is disabled by default, and those particular settings in config.php aren’t meant to be altered. Glad it works though, and thanks for sharing the steps you took! Will go ahead and close this but don’t hesitate to post again.

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

ExpressionEngine News!

#eecms, #events, #releases